From 9810e01cdd374be75a55aa7bcedd726ef48cba21 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Tue, 30 Mar 2021 19:35:23 +0100 Subject: [PATCH 001/659] Rebuilt for removed libstdc++ symbol (#1937698) --- chromium.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chromium.spec b/chromium.spec index 096b90d..2525326 100644 --- a/chromium.spec +++ b/chromium.spec @@ -216,7 +216,7 @@ Name: chromium%{chromium_channel}%{nsuffix} Name: chromium%{chromium_channel} %endif Version: %{majorversion}.0.4389.90 -Release: 3%{?dist} +Release: 4%{?dist} %if %{?freeworld} %if %{?shared} # chromium-libs-media-freeworld @@ -1977,6 +1977,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Tue Mar 30 2021 Jonathan Wakely - 89.0.4389.90-4 +- Rebuilt for removed libstdc++ symbol (#1937698) + * Thu Mar 25 2021 Tom Callaway - 89.0.4389.90-3 - apply upstream fix for newer system libva From 0ae19f4f97707e0fc120d17cfc7c0d3979928b36 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Wed, 2 Jun 2021 16:11:50 -0400 Subject: [PATCH 002/659] 91.0.4472.77 --- chromium-91-libyuv-aarch64.patch | 91 + chromium-91-pcscan-vector-types.patch | 47 + ....0.4472.77-aarch64-cxxflags-addition.patch | 14 + ...72.77-disable-fontconfig-cache-magic.patch | 13 + ...-91.0.4472.77-initial_prefs-etc-path.patch | 15 + ...-java-only-allowed-in-android-builds.patch | 13 + ...m-91.0.4472.77-update-highway-0.12.2.patch | 12203 ++++++++++++++++ chromium.spec | 57 +- clean_ffmpeg.sh | 2 +- sources | 2 +- 10 files changed, 12432 insertions(+), 25 deletions(-) create mode 100644 chromium-91-libyuv-aarch64.patch create mode 100644 chromium-91-pcscan-vector-types.patch create mode 100644 chromium-91.0.4472.77-aarch64-cxxflags-addition.patch create mode 100644 chromium-91.0.4472.77-disable-fontconfig-cache-magic.patch create mode 100644 chromium-91.0.4472.77-initial_prefs-etc-path.patch create mode 100644 chromium-91.0.4472.77-java-only-allowed-in-android-builds.patch create mode 100644 chromium-91.0.4472.77-update-highway-0.12.2.patch diff --git a/chromium-91-libyuv-aarch64.patch b/chromium-91-libyuv-aarch64.patch new file mode 100644 index 0000000..77b8f4c --- /dev/null +++ b/chromium-91-libyuv-aarch64.patch @@ -0,0 +1,91 @@ +diff --git a/third_party/libyuv/source/row_neon64.cc b/third_party/libyuv/source/row_neon64.cc +index 350c964..2aab413 100644 +--- a/third_party/libyuv/source/row_neon64.cc ++++ b/third_party/libyuv/source/row_neon64.cc +@@ -1835,7 +1835,7 @@ void ARGBToAB64Row_NEON(const uint8_t* src_argb, + : "+r"(src_argb), // %0 + "+r"(dst_ab64), // %1 + "+r"(width) // %2 +- : "m"(kShuffleARGBToABGR) // %3 ++ : "Q"(kShuffleARGBToABGR) // %3 + : "cc", "memory", "v0", "v1", "v2", "v3", "v4"); + } + +@@ -1859,7 +1859,7 @@ void AR64ToARGBRow_NEON(const uint16_t* src_ar64, + : "+r"(src_ar64), // %0 + "+r"(dst_argb), // %1 + "+r"(width) // %2 +- : "m"(kShuffleAR64ToARGB) // %3 ++ : "Q"(kShuffleAR64ToARGB) // %3 + : "cc", "memory", "v0", "v1", "v2", "v3", "v4"); + } + +@@ -1883,7 +1883,7 @@ void AB64ToARGBRow_NEON(const uint16_t* src_ab64, + : "+r"(src_ab64), // %0 + "+r"(dst_argb), // %1 + "+r"(width) // %2 +- : "m"(kShuffleAB64ToARGB) // %3 ++ : "Q"(kShuffleAB64ToARGB) // %3 + : "cc", "memory", "v0", "v1", "v2", "v3", "v4"); + } + +diff --git a/third_party/libyuv/source/scale_neon64.cc b/third_party/libyuv/source/scale_neon64.cc +index 8656fec..9f9636e 100644 +--- a/third_party/libyuv/source/scale_neon64.cc ++++ b/third_party/libyuv/source/scale_neon64.cc +@@ -601,8 +601,8 @@ void ScaleRowUp2_Bilinear_NEON(const uint8_t* src_ptr, + "umlal v4.8h, v1.8b, v31.8b \n" // 3*near+far (2, odd) + "umlal v5.8h, v0.8b, v31.8b \n" // 3*near+far (2, even) + +- "mov v0.8h, v4.8h \n" +- "mov v1.8h, v5.8h \n" ++ "mov v0.16b, v4.16b \n" ++ "mov v1.16b, v5.16b \n" + "mla v4.8h, v2.8h, v30.8h \n" // 9 3 3 1 (1, odd) + "mla v5.8h, v3.8h, v30.8h \n" // 9 3 3 1 (1, even) + "mla v2.8h, v0.8h, v30.8h \n" // 9 3 3 1 (2, odd) +@@ -642,7 +642,7 @@ void ScaleRowUp2_Linear_12_NEON(const uint16_t* src_ptr, + "ld1 {v1.8h}, [%1], #16 \n" // 12345678 (16b) + "prfm pldl1keep, [%0, 448] \n" // prefetch 7 lines ahead + +- "mov v2.8h, v0.8h \n" ++ "mov v2.16b, v0.16b \n" + "mla v0.8h, v1.8h, v31.8h \n" // 3*near+far (odd) + "mla v1.8h, v2.8h, v31.8h \n" // 3*near+far (even) + +@@ -679,7 +679,7 @@ void ScaleRowUp2_Bilinear_12_NEON(const uint16_t* src_ptr, + "ld1 {v3.8h}, [%2], #16 \n" // 12345678 (16b) + "prfm pldl1keep, [%0, 448] \n" // prefetch 7 lines ahead + +- "mov v0.8h, v2.8h \n" ++ "mov v0.16b, v2.16b \n" + "mla v2.8h, v3.8h, v31.8h \n" // 3*near+far (odd) + "mla v3.8h, v0.8h, v31.8h \n" // 3*near+far (even) + +@@ -687,12 +687,12 @@ void ScaleRowUp2_Bilinear_12_NEON(const uint16_t* src_ptr, + "ld1 {v5.8h}, [%3], #16 \n" // 12345678 (16b) + "prfm pldl1keep, [%1, 448] \n" // prefetch 7 lines ahead + +- "mov v0.8h, v4.8h \n" ++ "mov v0.16b, v4.16b \n" + "mla v4.8h, v5.8h, v31.8h \n" // 3*near+far (odd) + "mla v5.8h, v0.8h, v31.8h \n" // 3*near+far (even) + +- "mov v0.8h, v4.8h \n" +- "mov v1.8h, v5.8h \n" ++ "mov v0.16b, v4.16b \n" ++ "mov v1.16b, v5.16b \n" + "mla v4.8h, v2.8h, v31.8h \n" // 9 3 3 1 (1, odd) + "mla v5.8h, v3.8h, v31.8h \n" // 9 3 3 1 (1, even) + "mla v2.8h, v0.8h, v31.8h \n" // 9 3 3 1 (2, odd) +@@ -887,8 +887,8 @@ void ScaleUVRowUp2_Bilinear_NEON(const uint8_t* src_ptr, + "umlal v4.8h, v1.8b, v31.8b \n" // 3*near+far (2, odd) + "umlal v5.8h, v0.8b, v31.8b \n" // 3*near+far (2, even) + +- "mov v0.8h, v4.8h \n" +- "mov v1.8h, v5.8h \n" ++ "mov v0.16b, v4.16b \n" ++ "mov v1.16b, v5.16b \n" + "mla v4.8h, v2.8h, v30.8h \n" // 9 3 3 1 (1, odd) + "mla v5.8h, v3.8h, v30.8h \n" // 9 3 3 1 (1, even) + "mla v2.8h, v0.8h, v30.8h \n" // 9 3 3 1 (2, odd) diff --git a/chromium-91-pcscan-vector-types.patch b/chromium-91-pcscan-vector-types.patch new file mode 100644 index 0000000..33fc89e --- /dev/null +++ b/chromium-91-pcscan-vector-types.patch @@ -0,0 +1,47 @@ +From 429e6f78a88473208e96689afa2f6e91f07a4f8c Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Sat, 10 Apr 2021 17:02:49 +0000 +Subject: [PATCH] GCC: fix vector types in pcscan + + * _mm_cmpeq_epi64 result is __m128i + * maybe_ptrs is __m128i already and doesn't require cast + +Bug: 819294 +Change-Id: I3f8c6cc327191827838e80aea1431ac09315fe88 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2817544 +Reviewed-by: Anton Bikineev +Commit-Queue: Stephan Hartmann +Cr-Commit-Position: refs/heads/master@{#871265} +--- + +diff --git a/base/allocator/partition_allocator/starscan/pcscan.cc b/base/allocator/partition_allocator/starscan/pcscan.cc +index c7854ff..d5c0aea 100644 +--- a/base/allocator/partition_allocator/starscan/pcscan.cc ++++ b/base/allocator/partition_allocator/starscan/pcscan.cc +@@ -1143,7 +1143,7 @@ + const __m128i maybe_ptrs = + _mm_loadu_si128(reinterpret_cast<__m128i*>(payload)); + const __m128i vand = _mm_and_si128(maybe_ptrs, cage_mask); +- const __m128d vcmp = _mm_cmpeq_epi64(vand, vbase); ++ const __m128i vcmp = _mm_cmpeq_epi64(vand, vbase); + const int mask = _mm_movemask_pd(_mm_castsi128_pd(vcmp)); + if (LIKELY(!mask)) + continue; +@@ -1153,15 +1153,14 @@ + if (mask & 0b01) { + quarantine_size += + pcscan_task_.TryMarkObjectInNormalBuckets( +- _mm_cvtsi128_si64(_mm_castpd_si128(maybe_ptrs))); ++ _mm_cvtsi128_si64(maybe_ptrs)); + } + if (mask & 0b10) { + // Extraction intrinsics for qwords are only supported in SSE4.1, so + // instead we reshuffle dwords with pshufd. The mask is used to move the + // 4th and 3rd dwords into the second and first position. + static constexpr int kSecondWordMask = (3 << 2) | (2 << 0); +- const __m128i shuffled = +- _mm_shuffle_epi32(_mm_castpd_si128(maybe_ptrs), kSecondWordMask); ++ const __m128i shuffled = _mm_shuffle_epi32(maybe_ptrs, kSecondWordMask); + quarantine_size += + pcscan_task_.TryMarkObjectInNormalBuckets( + _mm_cvtsi128_si64(shuffled)); diff --git a/chromium-91.0.4472.77-aarch64-cxxflags-addition.patch b/chromium-91.0.4472.77-aarch64-cxxflags-addition.patch new file mode 100644 index 0000000..249adf4 --- /dev/null +++ b/chromium-91.0.4472.77-aarch64-cxxflags-addition.patch @@ -0,0 +1,14 @@ +diff -up chromium-91.0.4472.77/build/config/compiler/BUILD.gn.aarch-cxxflags chromium-91.0.4472.77/build/config/compiler/BUILD.gn +--- chromium-91.0.4472.77/build/config/compiler/BUILD.gn.aarch-cxxflags 2021-06-02 12:58:21.998750145 -0400 ++++ chromium-91.0.4472.77/build/config/compiler/BUILD.gn 2021-06-02 12:59:29.762092189 -0400 +@@ -1511,6 +1511,10 @@ config("default_warnings") { + cflags += [ "-Wno-psabi" ] + } + ++ if (current_cpu == "arm" && !is_clang) { ++ cflags_cc += [ "-flax-vector-conversions" ] ++ } ++ + if (!is_clang) { + cflags_cc += [ + # See comment for -Wno-c++11-narrowing. diff --git a/chromium-91.0.4472.77-disable-fontconfig-cache-magic.patch b/chromium-91.0.4472.77-disable-fontconfig-cache-magic.patch new file mode 100644 index 0000000..f3f362c --- /dev/null +++ b/chromium-91.0.4472.77-disable-fontconfig-cache-magic.patch @@ -0,0 +1,13 @@ +diff -up chromium-91.0.4472.77/base/test/BUILD.gn.nofontconfigcache chromium-91.0.4472.77/base/test/BUILD.gn +--- chromium-91.0.4472.77/base/test/BUILD.gn.nofontconfigcache 2021-06-01 16:41:40.094756454 -0400 ++++ chromium-91.0.4472.77/base/test/BUILD.gn 2021-06-01 16:42:47.736100516 -0400 +@@ -198,9 +198,6 @@ static_library("test_support") { + sources += [ "test_file_util_linux.cc" ] + public_deps += [ ":fontconfig_util_linux" ] + data_deps += [ "//third_party/test_fonts" ] +- if (current_toolchain == host_toolchain) { +- data_deps += [ ":do_generate_fontconfig_caches" ] +- } + } + + if (is_mac) { diff --git a/chromium-91.0.4472.77-initial_prefs-etc-path.patch b/chromium-91.0.4472.77-initial_prefs-etc-path.patch new file mode 100644 index 0000000..96825e2 --- /dev/null +++ b/chromium-91.0.4472.77-initial_prefs-etc-path.patch @@ -0,0 +1,15 @@ +diff -up chromium-91.0.4472.77/chrome/browser/first_run/first_run_internal_linux.cc.etc chromium-91.0.4472.77/chrome/browser/first_run/first_run_internal_linux.cc +--- chromium-91.0.4472.77/chrome/browser/first_run/first_run_internal_linux.cc.etc 2021-06-01 16:37:39.182531036 -0400 ++++ chromium-91.0.4472.77/chrome/browser/first_run/first_run_internal_linux.cc 2021-06-01 16:39:31.590102809 -0400 +@@ -20,9 +20,9 @@ bool IsOrganicFirstRun() { + + base::FilePath InitialPrefsPath() { + // The standard location of the initial prefs is next to the chrome binary. ++ // ...but we patch it to use /etc/chromium + base::FilePath initial_prefs; +- if (!base::PathService::Get(base::DIR_EXE, &initial_prefs)) +- return base::FilePath(); ++ initial_prefs = base::FilePath("/etc/chromium"); + + base::FilePath new_path = initial_prefs.AppendASCII(installer::kInitialPrefs); + if (base::PathIsReadable(new_path)) diff --git a/chromium-91.0.4472.77-java-only-allowed-in-android-builds.patch b/chromium-91.0.4472.77-java-only-allowed-in-android-builds.patch new file mode 100644 index 0000000..a4748d9 --- /dev/null +++ b/chromium-91.0.4472.77-java-only-allowed-in-android-builds.patch @@ -0,0 +1,13 @@ +diff -up chromium-91.0.4472.77/third_party/closure_compiler/compiler.py.java-allowed chromium-91.0.4472.77/third_party/closure_compiler/compiler.py +--- chromium-91.0.4472.77/third_party/closure_compiler/compiler.py.java-allowed 2021-06-02 17:14:48.445064647 +0000 ++++ chromium-91.0.4472.77/third_party/closure_compiler/compiler.py 2021-06-02 17:15:12.994836949 +0000 +@@ -13,8 +13,7 @@ import subprocess + + + _CURRENT_DIR = os.path.join(os.path.dirname(__file__)) +-_JAVA_PATH = os.path.join(_CURRENT_DIR, "..", "jdk", "current", "bin", "java") +-assert os.path.isfile(_JAVA_PATH), "java only allowed in android builds" ++_JAVA_PATH = "java" + + class Compiler(object): + """Runs the Closure compiler on given source files to typecheck them diff --git a/chromium-91.0.4472.77-update-highway-0.12.2.patch b/chromium-91.0.4472.77-update-highway-0.12.2.patch new file mode 100644 index 0000000..7b53aac --- /dev/null +++ b/chromium-91.0.4472.77-update-highway-0.12.2.patch @@ -0,0 +1,12203 @@ +diff -up chromium-91.0.4472.77/buildtools/third_party/libc++/trunk/test/std/utilities/time/time.hms/time.12 chromium-91.0.4472.77/buildtools/third_party/libc++/trunk/test/std/utilities/time/time.hms/time +diff -up chromium-91.0.4472.77/third_party/blink/web_tests/platform/mac-mac10.12 chromium-91.0.4472.77/third_party/blink/web_tests/platform/mac-mac10 +diff -up chromium-91.0.4472.77/third_party/catapult/telemetry/third_party/modulegraph/modulegraph_tests/testdata/nspkg/distribute-0.6.12 chromium-91.0.4472.77/third_party/catapult/telemetry/third_party/modulegraph/modulegraph_tests/testdata/nspkg/distribute-0.6 +diff -up chromium-91.0.4472.77/third_party/highway/src/CMakeLists.txt.12 chromium-91.0.4472.77/third_party/highway/src/CMakeLists.txt +--- chromium-91.0.4472.77/third_party/highway/src/CMakeLists.txt.12 2021-06-02 10:56:05.305904746 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/CMakeLists.txt 2021-05-31 10:37:11.000000000 -0400 +@@ -19,7 +19,7 @@ if(POLICY CMP0083) + cmake_policy(SET CMP0083 NEW) + endif() + +-project(hwy VERSION 0.1) ++project(hwy VERSION 0.12.2) # Keep in sync with highway.h version + + set(CMAKE_CXX_STANDARD 11) + set(CMAKE_CXX_EXTENSIONS OFF) +@@ -40,6 +40,8 @@ if (NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE RelWithDebInfo) + endif() + ++set(HWY_CMAKE_ARM7 OFF CACHE BOOL "Set copts for ARMv7 with NEON?") ++ + include(CheckCXXSourceCompiles) + check_cxx_source_compiles( + "int main() { +@@ -51,10 +53,13 @@ check_cxx_source_compiles( + HWY_EMSCRIPTEN + ) + ++set(HWY_CONTRIB_SOURCES ++ hwy/contrib/image/image.cc ++ hwy/contrib/image/image.h ++ hwy/contrib/math/math-inl.h ++) ++ + set(HWY_SOURCES +- contrib/image/image.cc +- contrib/image/image.h +- contrib/math/math-inl.h + hwy/aligned_allocator.cc + hwy/aligned_allocator.h + hwy/base.h +@@ -64,6 +69,7 @@ set(HWY_SOURCES + hwy/nanobenchmark.cc + hwy/nanobenchmark.h + hwy/ops/arm_neon-inl.h ++ hwy/ops/arm_sve-inl.h + hwy/ops/scalar-inl.h + hwy/ops/set_macros-inl.h + hwy/ops/shared-inl.h +@@ -146,13 +152,28 @@ else() + -fno-exceptions + ) + endif() +-endif() ++ ++ if (HWY_CMAKE_ARM7) ++ list(APPEND HWY_FLAGS ++ -march=armv7-a ++ -mfpu=neon-vfpv4 ++ -mfloat-abi=hard # must match the toolchain specified as CXX= ++ -mfp16-format=ieee # required for vcvt_f32_f16 ++ ) ++ endif() # HWY_CMAKE_ARM7 ++ ++endif() # !MSVC + + add_library(hwy STATIC ${HWY_SOURCES}) + target_compile_options(hwy PRIVATE ${HWY_FLAGS}) + set_property(TARGET hwy PROPERTY POSITION_INDEPENDENT_CODE ON) + target_include_directories(hwy PUBLIC ${CMAKE_CURRENT_LIST_DIR}) + ++add_library(hwy_contrib STATIC ${HWY_CONTRIB_SOURCES}) ++target_compile_options(hwy_contrib PRIVATE ${HWY_FLAGS}) ++set_property(TARGET hwy_contrib PROPERTY POSITION_INDEPENDENT_CODE ON) ++target_include_directories(hwy_contrib PUBLIC ${CMAKE_CURRENT_LIST_DIR}) ++ + # -------------------------------------------------------- install library + install(TARGETS hwy + DESTINATION "${CMAKE_INSTALL_LIBDIR}") +@@ -166,9 +187,21 @@ foreach (source ${HWY_SOURCES}) + endif() + endforeach() + +-# Add a pkg-config file for libhwy and the test library. ++install(TARGETS hwy_contrib ++ DESTINATION "${CMAKE_INSTALL_LIBDIR}") ++# Install all the headers keeping the relative path to the current directory ++# when installing them. ++foreach (source ${HWY_CONTRIB_SOURCES}) ++ if ("${source}" MATCHES "\.h$") ++ get_filename_component(dirname "${source}" DIRECTORY) ++ install(FILES "${source}" ++ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${dirname}") ++ endif() ++endforeach() ++ ++# Add a pkg-config file for libhwy and the contrib/test libraries. + set(HWY_LIBRARY_VERSION "${CMAKE_PROJECT_VERSION}") +-foreach (pc libhwy.pc libhwy-test.pc) ++foreach (pc libhwy.pc libhwy-contrib.pc libhwy-test.pc) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${pc}.in" "${pc}" @ONLY) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${pc}" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") +@@ -193,34 +226,13 @@ add_custom_command(TARGET hwy POST_BUILD + # Avoids mismatch between GTest's static CRT and our dynamic. + set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) + +-add_executable(skeleton hwy/examples/skeleton_main.cc) +-target_sources(skeleton PRIVATE +- hwy/examples/skeleton-inl.h +- hwy/examples/skeleton.cc +- hwy/examples/skeleton.h +- hwy/examples/skeleton_shared.h) +-# Try adding either -DHWY_COMPILE_ONLY_SCALAR or -DHWY_COMPILE_ONLY_STATIC to +-# observe the difference in targets printed. +-target_compile_options(skeleton PRIVATE ${HWY_FLAGS}) +-target_link_libraries(skeleton hwy) +-set_target_properties(skeleton +- PROPERTIES RUNTIME_OUTPUT_DIRECTORY "examples/") +- +-# Similar: shared headers but without the runtime dispatch in skeleton.cc/h +-add_executable(skeleton_static hwy/examples/skeleton_static_main.cc) +-target_sources(skeleton_static PRIVATE +- hwy/examples/skeleton-inl.h +- hwy/examples/skeleton_shared.h) +-target_compile_options(skeleton_static PRIVATE ${HWY_FLAGS}) +-target_link_libraries(skeleton_static hwy) +-set_target_properties(skeleton_static +- PROPERTIES RUNTIME_OUTPUT_DIRECTORY "examples/") +- + # Programming exercise with integrated benchmark + add_executable(hwy_benchmark hwy/examples/benchmark.cc) + target_sources(hwy_benchmark PRIVATE + hwy/nanobenchmark.cc + hwy/nanobenchmark.h) ++# Try adding either -DHWY_COMPILE_ONLY_SCALAR or -DHWY_COMPILE_ONLY_STATIC to ++# observe the difference in targets printed. + target_compile_options(hwy_benchmark PRIVATE ${HWY_FLAGS}) + target_link_libraries(hwy_benchmark hwy) + set_target_properties(hwy_benchmark +@@ -272,19 +284,21 @@ endif() + endif() # HWY_SYSTEM_GTEST + + set(HWY_TEST_FILES +- contrib/image/image_test.cc +- # contrib/math/math_test.cc ++ hwy/contrib/image/image_test.cc ++ # hwy/contrib/math/math_test.cc ++ hwy/aligned_allocator_test.cc ++ hwy/base_test.cc ++ hwy/highway_test.cc ++ hwy/targets_test.cc + hwy/examples/skeleton_test.cc + hwy/tests/arithmetic_test.cc + hwy/tests/combine_test.cc + hwy/tests/compare_test.cc + hwy/tests/convert_test.cc +- hwy/tests/hwy_test.cc + hwy/tests/logical_test.cc + hwy/tests/memory_test.cc + hwy/tests/swizzle_test.cc +- hwy/aligned_allocator_test.cc +- hwy/targets_test.cc ++ hwy/tests/test_util_test.cc + ) + + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tests) +@@ -293,11 +307,16 @@ foreach (TESTFILE IN LISTS HWY_TEST_FILE + get_filename_component(TESTNAME ${TESTFILE} NAME_WE) + add_executable(${TESTNAME} ${TESTFILE}) + target_compile_options(${TESTNAME} PRIVATE ${HWY_FLAGS}) ++ # Test all targets, not just the best/baseline. This changes the default ++ # policy to all-attainable; note that setting -DHWY_COMPILE_* directly can ++ # cause compile errors because only one may be set, and other CMakeLists.txt ++ # that include us may set them. ++ target_compile_options(${TESTNAME} PRIVATE -DHWY_IS_TEST=1) + + if(HWY_SYSTEM_GTEST) +- target_link_libraries(${TESTNAME} hwy GTest::GTest GTest::Main) ++ target_link_libraries(${TESTNAME} hwy hwy_contrib GTest::GTest GTest::Main) + else() +- target_link_libraries(${TESTNAME} hwy gtest gtest_main) ++ target_link_libraries(${TESTNAME} hwy hwy_contrib gtest gtest_main) + endif() + # Output test targets in the test directory. + set_target_properties(${TESTNAME} PROPERTIES PREFIX "tests/") +diff -up chromium-91.0.4472.77/third_party/highway/src/CMakeLists.txtE.12 chromium-91.0.4472.77/third_party/highway/src/CMakeLists.txtE +diff -up chromium-91.0.4472.77/third_party/highway/src/CMakeLists.txt.in.12 chromium-91.0.4472.77/third_party/highway/src/CMakeLists.txt.in +diff -up chromium-91.0.4472.77/third_party/highway/src/CMakeLists.txt.inE.12 chromium-91.0.4472.77/third_party/highway/src/CMakeLists.txt.inE +diff -up chromium-91.0.4472.77/third_party/highway/src/contrib/image/image.cc.12 chromium-91.0.4472.77/third_party/highway/src/contrib/image/image.cc +diff -up chromium-91.0.4472.77/third_party/highway/src/contrib/image/image.ccE.12 chromium-91.0.4472.77/third_party/highway/src/contrib/image/image.ccE +diff -up chromium-91.0.4472.77/third_party/highway/src/contrib/image/image.h.12 chromium-91.0.4472.77/third_party/highway/src/contrib/image/image.h +diff -up chromium-91.0.4472.77/third_party/highway/src/contrib/image/image.hE.12 chromium-91.0.4472.77/third_party/highway/src/contrib/image/image.hE +diff -up chromium-91.0.4472.77/third_party/highway/src/contrib/image/image_test.cc.12 chromium-91.0.4472.77/third_party/highway/src/contrib/image/image_test.cc +diff -up chromium-91.0.4472.77/third_party/highway/src/contrib/image/image_test.ccE.12 chromium-91.0.4472.77/third_party/highway/src/contrib/image/image_test.ccE +diff -up chromium-91.0.4472.77/third_party/highway/src/contrib/math/math-inl.h.12 chromium-91.0.4472.77/third_party/highway/src/contrib/math/math-inl.h +diff -up chromium-91.0.4472.77/third_party/highway/src/contrib/math/math-inl.hE.12 chromium-91.0.4472.77/third_party/highway/src/contrib/math/math-inl.hE +diff -up chromium-91.0.4472.77/third_party/highway/src/contrib/math/math_test.cc.12 chromium-91.0.4472.77/third_party/highway/src/contrib/math/math_test.cc +diff -up chromium-91.0.4472.77/third_party/highway/src/contrib/math/math_test.ccE.12 chromium-91.0.4472.77/third_party/highway/src/contrib/math/math_test.ccE +diff -up chromium-91.0.4472.77/third_party/highway/src/CONTRIBUTING.12 chromium-91.0.4472.77/third_party/highway/src/CONTRIBUTING +diff -up chromium-91.0.4472.77/third_party/highway/src/CONTRIBUTINGE.12 chromium-91.0.4472.77/third_party/highway/src/CONTRIBUTINGE +diff -up chromium-91.0.4472.77/third_party/highway/src/debian/changelog.12 chromium-91.0.4472.77/third_party/highway/src/debian/changelog +--- chromium-91.0.4472.77/third_party/highway/src/debian/changelog.12 2021-06-02 10:56:05.151903967 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/debian/changelog 2021-05-31 10:37:11.000000000 -0400 +@@ -1,3 +1,26 @@ ++highway (0.12.2-1) UNRELEASED; urgency=medium ++ ++ * fix scalar-only test and Windows macro conflict with Load/StoreFence ++ * replace deprecated wasm intrinsics ++ ++ -- Jan Wassenberg Mon, 31 May 2021 16:00:00 +0200 ++ ++highway (0.12.1-1) UNRELEASED; urgency=medium ++ ++ * doc updates, ARM GCC support, fix s390/ppc, complete partial vectors ++ * fix warnings, faster ARM div/sqrt, separate hwy_contrib library ++ * add Abs(i64)/FirstN/Pause, enable AVX2 on MSVC ++ ++ -- Jan Wassenberg Wed, 19 May 2021 15:00:00 +0200 ++ ++highway (0.12.0-1) UNRELEASED; urgency=medium ++ ++ * Add Shift*8, Compress16, emulated Scatter/Gather, StoreInterleaved3/4 ++ * Remove deprecated HWY_*_LANES, deprecate HWY_GATHER_LANES ++ * Proper IEEE rounding, reduce libstdc++ usage, inlined math ++ ++ -- Jan Wassenberg Thu, 15 Apr 2021 20:00:00 +0200 ++ + highway (0.11.1-1) UNRELEASED; urgency=medium + + * Fix clang7 asan error, finish f16 conversions and add test +diff -up chromium-91.0.4472.77/third_party/highway/src/debian/changelogE.12 chromium-91.0.4472.77/third_party/highway/src/debian/changelogE +diff -up chromium-91.0.4472.77/third_party/highway/src/debian/compat.12 chromium-91.0.4472.77/third_party/highway/src/debian/compat +diff -up chromium-91.0.4472.77/third_party/highway/src/debian/compatE.12 chromium-91.0.4472.77/third_party/highway/src/debian/compatE +diff -up chromium-91.0.4472.77/third_party/highway/src/debian/control.12 chromium-91.0.4472.77/third_party/highway/src/debian/control +diff -up chromium-91.0.4472.77/third_party/highway/src/debian/controlE.12 chromium-91.0.4472.77/third_party/highway/src/debian/controlE +diff -up chromium-91.0.4472.77/third_party/highway/src/debian/copyright.12 chromium-91.0.4472.77/third_party/highway/src/debian/copyright +diff -up chromium-91.0.4472.77/third_party/highway/src/debian/copyrightE.12 chromium-91.0.4472.77/third_party/highway/src/debian/copyrightE +diff -up chromium-91.0.4472.77/third_party/highway/src/debian/rules.12 chromium-91.0.4472.77/third_party/highway/src/debian/rules +diff -up chromium-91.0.4472.77/third_party/highway/src/debian/rulesE.12 chromium-91.0.4472.77/third_party/highway/src/debian/rulesE +diff -up chromium-91.0.4472.77/third_party/highway/src/debian/source/format.12 chromium-91.0.4472.77/third_party/highway/src/debian/source/format +diff -up chromium-91.0.4472.77/third_party/highway/src/debian/source/formatE.12 chromium-91.0.4472.77/third_party/highway/src/debian/source/formatE +diff -up chromium-91.0.4472.77/third_party/highway/src/g3doc/highway_intro.pdf.12 chromium-91.0.4472.77/third_party/highway/src/g3doc/highway_intro.pdf +Binary files chromium-91.0.4472.77/third_party/highway/src/g3doc/highway_intro.pdf.12 and chromium-91.0.4472.77/third_party/highway/src/g3doc/highway_intro.pdf differ +diff -up chromium-91.0.4472.77/third_party/highway/src/g3doc/highway_intro.pdfE.12 chromium-91.0.4472.77/third_party/highway/src/g3doc/highway_intro.pdfE +diff -up chromium-91.0.4472.77/third_party/highway/src/g3doc/instruction_matrix.pdf.12 chromium-91.0.4472.77/third_party/highway/src/g3doc/instruction_matrix.pdf +diff -up chromium-91.0.4472.77/third_party/highway/src/g3doc/instruction_matrix.pdfE.12 chromium-91.0.4472.77/third_party/highway/src/g3doc/instruction_matrix.pdfE +diff -up chromium-91.0.4472.77/third_party/highway/src/g3doc/quick_reference.md.12 chromium-91.0.4472.77/third_party/highway/src/g3doc/quick_reference.md +--- chromium-91.0.4472.77/third_party/highway/src/g3doc/quick_reference.md.12 2021-06-02 10:56:05.117903795 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/g3doc/quick_reference.md 2021-05-31 10:37:11.000000000 -0400 +@@ -33,6 +33,12 @@ The public headers are: + * hwy/cache_control.h: defines stand-alone functions to control caching (e.g. + prefetching) and memory barriers, independent of actual SIMD. + ++* hwy/nanobenchmark.h: library for precisely measuring elapsed time (under ++ varying inputs) for benchmarking small/medium regions of code. ++ ++* hwy/tests/test_util-inl.h: defines macros for invoking tests on all ++ available targets, plus per-target functions useful in tests (e.g. Print). ++ + SIMD implementations must be preceded and followed by the following: + + ``` +@@ -61,76 +67,76 @@ HWY_AFTER_NAMESPACE(); + + ## Vector and descriptor types + +-Highway vectors consist of one or more 'lanes' of the same built-in type `T = +-uint##_t, int##_t` for `## = 8, 16, 32, 64`, plus `T = float##_t` for `## = 16, +-32, 64`. `float16_t` is an IEEE binary16 half-float and only supports load, +-store, and conversion to/from `float32_t`; infinity or NaN have +-implementation-defined results. +- +-Each vector has `N` lanes (a power of two, possibly unknown at compile time). +- +-Platforms such as x86 support multiple vector types, and other platforms require +-that vectors are built-in types. On RVV, vectors are sizeless and thus cannot be +-wrapped inside a class. The Highway API satisfies these constraints because it +-is designed around overloaded functions selected via a zero-sized tag parameter +-`d` of type `D = Simd`. These are typically constructed using aliases: +- +-* `const HWY_FULL(T[, LMUL=1]) d;` chooses an `N` that results in a native +- vector for the current target. For targets (e.g. RVV) that support register +- groups, the optional `LMUL` (1, 2, 4, 8) specifies the number of registers +- in the group. This effectively multiplies the lane count in each operation +- by `LMUL`. For mixed-precision code, `LMUL` must be at least the ratio of +- the sizes of the largest and smallest type. `LMUL > 1` is more efficient on +- single-issue machines, but larger values reduce the effective number of +- registers, which may cause the compiler to spill them to memory. ++Highway vectors consist of one or more 'lanes' of the same built-in type ++`uint##_t, int##_t` for `## = 8, 16, 32, 64`, plus `float##_t` for `## = 16, 32, ++64`. ++ ++In Highway, `float16_t` (an IEEE binary16 half-float) only supports load, store, ++and conversion to/from `float32_t`; the behavior of `float16_t` infinity and NaN ++are implementation-defined due to ARMv7. ++ ++On RVV, vectors are sizeless and cannot be wrapped inside a class. The Highway ++API allows using built-in types as vectors because operations are expressed as ++overloaded functions. Instead of constructors, overloaded initialization ++functions such as `Set` take a zero-sized tag argument called `d` of type `D = ++Simd` and return an actual vector of unspecified type. ++ ++`T` is one of the lane types above, and may be retrieved via `TFromD`. ++ ++`N` is target-dependent and not directly user-specified. The actual lane count ++may not be known at compile time, but can be obtained via `Lanes(d)`. Use this ++value, which is potentially different from `N`, to increment loop counters etc. ++It is typically a power of two, but that is not guaranteed e.g. on SVE. ++ ++`d` lvalues (a tag, NOT actual vector) are typically obtained using two aliases: ++ ++* Most common: pass `HWY_FULL(T[, LMUL=1]) d;` as an argument to return a ++ native vector. This is preferred because it fully utilizes vector lanes. ++ ++ For targets (e.g. RVV) that support register groups, the optional `LMUL` (1, ++ 2, 4, 8) specifies the number of registers in the group. This effectively ++ multiplies the lane count in each operation by `LMUL`. For mixed-precision ++ code, `LMUL` must be at least the ratio of the sizes of the largest and ++ smallest type. `LMUL > 1` is more efficient on single-issue machines, but ++ larger values reduce the effective number of registers, which may cause the ++ compiler to spill them to memory. ++ ++* Less common: pass `HWY_CAPPED(T, N) d;` as an argument to return a vector ++ which may be native width, but no more than `N` lanes have observable ++ effects such as loading/storing to memory. This is less performance-portable ++ because it may not use all available lanes. Note that the resulting lane ++ count may also be less than `N`. ++ ++ For targets (e.g. RVV) that have compile-time-unknown lane counts, such ++ vectors incur additional runtime cost in `Load` etc. ++ ++User-specified lane counts or tuples of vectors could cause spills on targets ++with fewer or smaller vectors. By contrast, Highway encourages vector-length ++agnostic code, which is more performance-portable. ++ ++Given that lane counts are potentially compile-time-unknown, storage for vectors ++should be dynamically allocated, e.g. via `AllocateAligned(Lanes(d))`. For ++applications that require a compile-time estimate, `MaxLanes(d)` returns the `N` ++from `Simd`, which is NOT necessarily the actual lane count. This is ++DISCOURAGED because it is not guaranteed to be an upper bound (RVV vectors may ++be very large) and some compilers are not able to interpret it as constexpr. + +-* `const HWY_CAPPED(T, N) d;` for up to `N` lanes. +- +-For mixed-precision code (e.g. `uint8_t` lanes promoted to `float`), descriptors +-for the smaller types must be obtained from those of the larger type (e.g. via ++For mixed-precision code (e.g. `uint8_t` lanes promoted to `float`), tags for ++the smaller types must be obtained from those of the larger type (e.g. via + `Rebind`). + +-The type `T` may be accessed as `TFromD`. There are three possibilities for +-the template parameter `N`: +- +-1. Equal to the hardware vector width, e.g. when using `HWY_FULL(T)` on a +- target with compile-time constant vectors. ++## Using unspecified vector types + +-1. Less than the hardware vector width. This is the result of a compile-time +- decision by the user, i.e. using `HWY_CAPPED(T, N)` to limit the number of +- lanes, even when the hardware vector width could be greater. +- +-1. Unrelated to the hardware vector width, e.g. when the hardware vector width +- is not known at compile-time and may be very large. +- +-In all cases, `Lanes(d)` returns the actual number of lanes, i.e. the amount by +-which to advance loop counters. `MaxLanes(d)` returns the `N` from `Simd`, +-which is NOT necessarily the actual vector size (see above) and some compilers +-are not able to interpret it as constexpr. Instead of `MaxLanes`, prefer to use +-alternatives, e.g. `Rebind` or `aligned_allocator.h` for dynamic allocation of +-`Lanes(d)` elements. +- +-Highway is designed to map a vector variable to a (possibly partial) hardware +-register or register group. By discouraging user-specified `N` and tuples of +-vector variables, we improve performance portability (e.g. by reducing spills to +-memory for platforms that have smaller vectors than the developer expected). +- +-To construct vectors, call factory functions (see "Initialization" below) with +-a tag parameter `d`. +- +-Local variables typically use auto for type deduction. For some generic +-functions, a template argument `V` is sufficient: `template V Squared(V +-v) { return v * v; }`. In general, functions have a `D` template argument and +-can return vectors of type `Vec`. +- +-Note that Highway functions reside in `hwy::HWY_NAMESPACE`, whereas user-defined +-functions reside in `project::[nested]::HWY_NAMESPACE`. Because all Highway +-functions generally take either a `Simd` or vector argument, which are also +-defined in namespace `hwy`, they will typically be found via Argument-Dependent +-Lookup and namespace qualifiers are not necessary. As an exception, Highway +-functions that are templates (e.g. because they require a compile-time argument +-such as a lane index or shift count) require a using-declaration such as +-`using hwy::HWY_NAMESPACE::ShiftLeft`. ++Because vector types are unspecified, local vector variables are typically ++defined using `auto` for type deduction. A template argument `V` suffices for ++simple generic functions: `template V Squared(V v) { return v * v; }`. ++ ++Many functions will need a `D` template argument in order to initialize any ++constants. They can use a separate `V` template argument for vectors, or use ++`Vec`, or where an lvalue `d` is available, `decltype(Zero(d))`. Using such ++aliases instead of auto may improve readability of mixed-type code. They can ++also be used for member variables, which are discouraged because compilers often ++have difficulty mapping them to registers. + + ## Operations + +@@ -141,6 +147,14 @@ unsigned, signed, and floating-point typ + bits per lane: 8, 16, 32, or 64. Any combination of the specified prefixes and + bits are allowed. Abbreviations of the form `u32 = {u}{32}` may also be used. + ++Note that Highway functions reside in `hwy::HWY_NAMESPACE`, whereas user-defined ++functions reside in `project::[nested]::HWY_NAMESPACE`. Highway functions ++generally take either a `Simd` or vector/mask argument. For targets where ++vectors and masks are defined in namespace `hwy`, the functions will be found ++via Argument-Dependent Lookup. However, this does not work for function ++templates, and RVV and SVE both use builtin vectors. Thus we recommend a `using ++hwy::HWY_NAMESPACE;` directive inside `project::[nested]::HWY_NAMESPACE`. ++ + ### Initialization + + * V **Zero**(D): returns N-lane vector with all bits set to 0. +@@ -162,7 +176,7 @@ bits are allowed. Abbreviations of the f + * `V`: `{i,f}` \ + V **Neg**(V a): returns `-a[i]`. + +-* `V`: `{i}{8,16,32}, {f}` \ ++* `V`: `{i,f}` \ + V **Abs**(V a) returns the absolute value of `a[i]`; for + integers, `LimitsMin()` maps to `LimitsMax() + 1`. + +@@ -252,23 +266,24 @@ Left-shifting signed `T` and right-shift + shifting `MakeUnsigned` and casting to `T`. Right-shifting negative signed + `T` is the same as an unsigned shift, except that 1-bits are shifted in. + +-Compile-time constant shifts, generally the most efficient variant: ++Compile-time constant shifts, generally the most efficient variant (though 8-bit ++shifts are potentially slower than other lane sizes): + +-* `V`: `{u,i}{16,32,64}` \ ++* `V`: `{u,i}` \ + V **ShiftLeft**<int>(V a) returns `a[i] << int`. + +-* `V`: `{u,i}{16,32,64}` \ ++* `V`: `{u,i}` \ + V **ShiftRight**<int>(V a) returns `a[i] >> int`. + + Shift all lanes by the same (not necessarily compile-time constant) amount: + +-* `V`: `{u,i}{16,32,64}` \ ++* `V`: `{u,i}` \ + V **ShiftLeftSame**(V a, int bits) returns `a[i] << bits`. + +-* `V`: `{u,i}{16,32,64}` \ ++* `V`: `{u,i}` \ + V **ShiftRightSame**(V a, int bits) returns `a[i] >> bits`. + +-Per-lane variable shifts (slow if SSE4, or Shr i64 on AVX2): ++Per-lane variable shifts (slow if SSE4, or 16-bit, or Shr i64 on AVX2): + + * `V`: `{u,i}{16,32,64}` \ + V **operator<<**(V a, V b) returns `a[i] << b[i]`. +@@ -332,12 +347,17 @@ Special functions for signed types: + slightly more efficient; requires the first argument to be non-negative. + + * `V`: `i32/64` \ +- V **BroadcastSignBit(V a) returns `a[i] < 0 ? -1 : 0`. ++ V **BroadcastSignBit**(V a) returns `a[i] < 0 ? -1 : 0`. + + ### Masks + + Let `M` denote a mask capable of storing true/false for each lane. + ++* M **FirstN**(D, size_t N): returns mask with the first `N` ++ lanes (those with index `< N`) true. `N` larger than `Lanes(D())` result in ++ an all-true mask. Useful for implementing "masked" stores by loading `prev` ++ followed by `IfThenElse(FirstN(d, N), what_to_store, prev)`. ++ + * M1 **RebindMask**(D, M2 m): returns same mask bits as `m`, but + reinterpreted as a mask for lanes of type `TFromD`. `M1` and `M2` must + have the same number of lanes. +@@ -389,17 +409,18 @@ Let `M` denote a mask capable of storing + * size_t **CountTrue**(M m): returns how many of `m[i]` are true + [0, N]. This is typically more expensive than AllTrue/False. + +-* `V`: `{u,i,f}{32,64}` \ ++* `V`: `{u,i,f}{16,32,64}` \ + V **Compress**(V v, M m): returns `r` such that `r[n]` is + `v[i]`, with `i` the n-th lane index (starting from 0) where `m[i]` is true. + Compacts lanes whose mask is set into the lower lanes; upper lanes are +- implementation-defined. ++ implementation-defined. Slow with 16-bit lanes. + +-* `V`: `{u,i,f}{32,64}` \ ++* `V`: `{u,i,f}{16,32,64}` \ + size_t **CompressStore**(V v, M m, D, T* aligned): writes lanes + whose mask is set into `aligned`, starting from lane 0. Returns + `CountTrue(m)`, the number of valid lanes. All subsequent lanes may be +- overwritten! Alignment ensures inactive lanes will not cause faults. ++ overwritten! Alignment ensures inactive lanes will not cause faults. Slow ++ with 16-bit lanes. + + ### Comparisons + +@@ -429,10 +450,16 @@ Memory operands are little-endian, other + lane configuration. Pointers are the addresses of `N` consecutive `T` values, + either naturally-aligned (`aligned`) or possibly unaligned (`p`). + ++**Note**: computations with low arithmetic intensity (FLOP/s per memory traffic ++bytes), e.g. dot product, can be *1.5 times as fast* when the memory operands ++are naturally aligned. An unaligned access may require two load ports. ++ + #### Load + + * Vec<D> **Load**(D, const T* aligned): returns +- `aligned[i]`. ++ `aligned[i]`. May fault if the pointer is not aligned to the vector size. ++ Using this whenever possible improves codegen on SSE4: unlike `LoadU`, ++ `Load` can be fused into a memory operand, which reduces register pressure. + * Vec<D> **LoadU**(D, const T* p): returns `p[i]`. + + * Vec<D> **LoadDup128**(D, const T* p): returns one 128-bit +@@ -440,19 +467,31 @@ either naturally-aligned (`aligned`) or + be faster than broadcasting single values, and is more convenient than + preparing constants for the actual vector length. + +-#### Gather ++#### Scatter/Gather + +-**Note**: Vectors must be `HWY_CAPPED(T, HWY_GATHER_LANES(T))`: ++**Note**: Offsets/indices are of type `VI = Vec>` and need not ++be unique. The results are implementation-defined if any are negative. + +-* `V`,`VI`: (`{u,i,f}{32},i32`), (`{u,i,f}{64},i64`) \ +- Vec<D> **GatherOffset**(D, const T* base, VI offsets). +- Returns elements of base selected by possibly repeated *byte* `offsets[i]`. +- Results are implementation-defined if `offsets[i]` is negative. +- +-* `V`,`VI`: (`{u,i,f}{32},i32`), (`{u,i,f}{64},i64`) \ +- Vec<D> **GatherIndex**(D, const T* base, VI indices). +- Returns vector of `base[indices[i]]`. Indices need not be unique, but +- results are implementation-defined if they are negative. ++**Note**: Where possible, applications should `Load/Store/TableLookup*` entire ++vectors, which is much faster than `Scatter/Gather`. Otherwise, code of the form ++`dst[tbl[i]] = F(src[i])` should when possible be transformed to `dst[i] = ++F(src[tbl[i]])` because `Scatter` is more expensive than `Gather`. ++ ++* `D`: `{u,i,f}{32,64}` \ ++ void **ScatterOffset**(Vec<D> v, D, const T* base, VI ++ offsets): stores `v[i]` to the base address plus *byte* `offsets[i]`. ++ ++* `D`: `{u,i,f}{32,64}` \ ++ void **ScatterIndex**(Vec<D> v, D, const T* base, VI ++ indices): stores `v[i]` to `base[indices[i]]`. ++ ++* `D`: `{u,i,f}{32,64}` \ ++ Vec<D> **GatherOffset**(D, const T* base, VI offsets): ++ returns elements of base selected by *byte* `offsets[i]`. ++ ++* `D`: `{u,i,f}{32,64}` \ ++ Vec<D> **GatherIndex**(D, const T* base, VI indices): ++ returns vector of `base[indices[i]]`. + + #### Store + +@@ -462,6 +501,17 @@ either naturally-aligned (`aligned`) or + * void **StoreU**(Vec<D> a, D, T* p): as Store, but without + the alignment requirement. + ++* `D`: `u8` \ ++ void **StoreInterleaved3**(Vec<D> v0, Vec<D> v1, ++ Vec<D> v2, D, T* p): equivalent to shuffling `v0, v1, v2` ++ followed by three `StoreU()`, such that `p[0] == v0[0], p[1] == v1[0], ++ p[2] == v1[0]`. Useful for RGB samples. ++ ++* `D`: `u8` \ ++ void **StoreInterleaved4**(Vec<D> v0, Vec<D> v1, ++ Vec<D> v2, Vec<D> v3, D, T* p): as above, but for four ++ vectors (e.g. RGBA samples). ++ + ### Cache control + + All functions except Stream are defined in cache_control.h. +@@ -483,6 +533,9 @@ All functions except Stream are defined + * void **Prefetch**(const T* p): begins loading the cache line + containing "p". + ++* void **Pause**(): when called inside a spin-loop, may reduce ++ power consumption. ++ + ### Type conversion + + * Vec<D> **BitCast**(D, V): returns the bits of `V` +@@ -525,7 +578,8 @@ if the input exceeds the destination ran + zero and converts the value to same-sized integer. + + * `V`: `f32`; `Ret`: `i32` \ +- Ret **NearestInt**(V a): returns the integer nearest to `a[i]`. ++ Ret **NearestInt**(V a): returns the integer nearest to `a[i]`; ++ results are undefined for NaN. + + ### Swizzle + +@@ -652,9 +706,9 @@ more expensive on AVX2/AVX-512 than with + + ### Reductions + +-**Note**: the following are only available for full vectors (including scalar). +-These 'reduce' all lanes to a single result. This result is broadcasted to all +-lanes at no extra cost; you can use `GetLane` to obtain the value. ++**Note**: these 'reduce' all lanes to a single result (e.g. sum), which is ++broadcasted to all lanes at no extra cost. To obtain a scalar, you can call ++`GetLane`. + + Being a horizontal operation (across lanes of the same vector), these are slower + than normal SIMD operations and are typically used outside critical loops. +@@ -697,9 +751,6 @@ generate such instructions (implying the + finally reverts to `HWY_STATIC_TARGET`. Can be used in `#if` expressions to + provide an alternative to functions which are not supported by HWY_SCALAR. + +-* `HWY_LANES(T)`: how many lanes of type `T` in a full vector (>= 1). Used by +- HWY_FULL/CAPPED. Note: cannot be used in #if because it uses sizeof. +- + * `HWY_IDE` is 0 except when parsed by IDEs; adding it to conditions such as + `#if HWY_TARGET != HWY_SCALAR || HWY_IDE` avoids code appearing greyed out. + +@@ -707,26 +758,15 @@ The following signal capabilities and ex + + * `HWY_CAP_INTEGER64`: support for 64-bit signed/unsigned integer lanes. + * `HWY_CAP_FLOAT64`: support for double-precision floating-point lanes. ++ ++The following were used to signal the maximum number of lanes for certain ++operations, but this is no longer necessary (nor possible on SVE/RVV), so they ++are DEPRECATED: ++ ++* `HWY_GATHER_LANES(T)`. + * `HWY_CAP_GE256`: the current target supports vectors of >= 256 bits. + * `HWY_CAP_GE512`: the current target supports vectors of >= 512 bits. + +-The following indicate the maximum number of lanes for certain operations. For +-targets that support the feature/operation, the macro evaluates to +-`HWY_LANES(T)`, otherwise 1. Using `HWY_CAPPED(T, HWY_GATHER_LANES(T))` +-generates the best possible code (or scalar fallback) from the same source code. +- +-* `HWY_GATHER_LANES(T)`: supports GatherIndex/Offset. +-* `HWY_VARIABLE_SHIFT_LANES(T)`: supports per-lane shift amounts (v1 << v2). +- DEPRECATED, this always matches HWY_LANES(T) and will be removed. +- +-As above, but the feature implies the type so there is no T parameter, thus +-these can be used in `#if` expressions. +- +-* `HWY_COMPARE64_LANES`: 64-bit signed integer comparisons. DEPRECATED, this +- always matches HWY_LANES(int64_t) and will be removed. +-* `HWY_MINMAX64_LANES`: 64-bit signed/unsigned integer min/max. DEPRECATED, +- this always matches HWY_LANES(int64_t) and will be removed. +- + ## Detecting supported targets + + `SupportedTargets()` returns a cached (initialized on-demand) bitfield of the +@@ -778,8 +818,10 @@ policy for selecting `HWY_TARGETS`: + and permitted by the compiler, independently of autovectorization), which + maximizes coverage in tests. + +-If none are defined, the default is to select all attainable targets except any +-non-best baseline (typically `HWY_SCALAR`), which reduces code size. ++If none are defined, but `HWY_IS_TEST` is defined, the default is ++`HWY_COMPILE_ALL_ATTAINABLE`. Otherwise, the default is to select all attainable ++targets except any non-best baseline (typically `HWY_SCALAR`), which reduces ++code size. + + ## Compiler support + +@@ -787,7 +829,8 @@ Clang and GCC require e.g. -mavx2 flags + However, this enables AVX2 instructions in the entire translation unit, which + may violate the one-definition rule and cause crashes. Instead, we use + target-specific attributes introduced via #pragma. Function using SIMD must +-reside between `HWY_BEFORE_NAMESPACE` and `HWY_AFTER_NAMESPACE`. ++reside between `HWY_BEFORE_NAMESPACE` and `HWY_AFTER_NAMESPACE`. Alternatively, ++individual functions or lambdas may be prefixed with `HWY_ATTR`. + + Immediates (compile-time constants) are specified as template arguments to avoid + constant-propagation issues with Clang on ARM. +diff -up chromium-91.0.4472.77/third_party/highway/src/g3doc/quick_reference.mdE.12 chromium-91.0.4472.77/third_party/highway/src/g3doc/quick_reference.mdE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/aligned_allocator.cc.12 chromium-91.0.4472.77/third_party/highway/src/hwy/aligned_allocator.cc +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/aligned_allocator.ccE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/aligned_allocator.ccE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/aligned_allocator.h.12 chromium-91.0.4472.77/third_party/highway/src/hwy/aligned_allocator.h +--- chromium-91.0.4472.77/third_party/highway/src/hwy/aligned_allocator.h.12 2021-06-02 10:56:05.278904609 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/aligned_allocator.h 2021-05-31 10:37:11.000000000 -0400 +@@ -111,6 +111,32 @@ AlignedUniquePtr MakeUniqueAligned(Ar + new (ptr) T(std::forward(args)...), AlignedDeleter()); + } + ++// Helpers for array allocators (avoids overflow) ++namespace detail { ++ ++// Returns x such that 1u << x == n (if n is a power of two). ++static inline constexpr size_t ShiftCount(size_t n) { ++ return (n <= 1) ? 0 : 1 + ShiftCount(n / 2); ++} ++ ++template ++T* AllocateAlignedItems(size_t items, AllocPtr alloc_ptr, void* opaque_ptr) { ++ constexpr size_t size = sizeof(T); ++ ++ constexpr bool is_pow2 = (size & (size - 1)) == 0; ++ constexpr size_t bits = ShiftCount(size); ++ static_assert(!is_pow2 || (1ull << bits) == size, "ShiftCount is incorrect"); ++ ++ const size_t bytes = is_pow2 ? items << bits : items * size; ++ const size_t check = is_pow2 ? bytes >> bits : bytes / size; ++ if (check != items) { ++ return nullptr; // overflowed ++ } ++ return static_cast(AllocateAlignedBytes(bytes, alloc_ptr, opaque_ptr)); ++} ++ ++} // namespace detail ++ + // Aligned memory equivalent of make_unique for array types using the + // custom allocators alloc/free. This function calls the constructor with the + // passed Args... on every created item. The destructor of each element will be +@@ -118,10 +144,11 @@ AlignedUniquePtr MakeUniqueAligned(Ar + template + AlignedUniquePtr MakeUniqueAlignedArrayWithAlloc( + size_t items, AllocPtr alloc, FreePtr free, void* opaque, Args&&... args) { +- T* ptr = +- static_cast(AllocateAlignedBytes(items * sizeof(T), alloc, opaque)); +- for (size_t i = 0; i < items; i++) { +- new (ptr + i) T(std::forward(args)...); ++ T* ptr = detail::AllocateAlignedItems(items, alloc, opaque); ++ if (ptr != nullptr) { ++ for (size_t i = 0; i < items; i++) { ++ new (ptr + i) T(std::forward(args)...); ++ } + } + return AlignedUniquePtr(ptr, AlignedDeleter(free, opaque)); + } +@@ -165,7 +192,7 @@ template + AlignedFreeUniquePtr AllocateAligned(const size_t items, AllocPtr alloc, + FreePtr free, void* opaque) { + return AlignedFreeUniquePtr( +- static_cast(AllocateAlignedBytes(items * sizeof(T), alloc, opaque)), ++ detail::AllocateAlignedItems(items, alloc, opaque), + AlignedFreer(free, opaque)); + } + +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/aligned_allocator.hE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/aligned_allocator.hE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/aligned_allocator_test.cc.12 chromium-91.0.4472.77/third_party/highway/src/hwy/aligned_allocator_test.cc +--- chromium-91.0.4472.77/third_party/highway/src/hwy/aligned_allocator_test.cc.12 2021-06-02 10:56:05.273904584 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/aligned_allocator_test.cc 2021-05-31 10:37:11.000000000 -0400 +@@ -16,6 +16,7 @@ + + #include + ++#include + #include + #include + #include +@@ -87,13 +88,39 @@ TEST(AlignedAllocatorTest, FreeNullptr) + /*opaque_ptr=*/nullptr); + } + ++TEST(AlignedAllocatorTest, Log2) { ++ EXPECT_EQ(0u, detail::ShiftCount(1)); ++ EXPECT_EQ(1u, detail::ShiftCount(2)); ++ EXPECT_EQ(3u, detail::ShiftCount(8)); ++} ++ ++// Allocator returns null when it detects overflow of items * sizeof(T). ++TEST(AlignedAllocatorTest, Overflow) { ++ constexpr size_t max = ~size_t(0); ++ constexpr size_t msb = (max >> 1) + 1; ++ using Size5 = std::array; ++ using Size10 = std::array; ++ EXPECT_EQ(nullptr, ++ detail::AllocateAlignedItems(max / 2, nullptr, nullptr)); ++ EXPECT_EQ(nullptr, ++ detail::AllocateAlignedItems(max / 3, nullptr, nullptr)); ++ EXPECT_EQ(nullptr, ++ detail::AllocateAlignedItems(max / 4, nullptr, nullptr)); ++ EXPECT_EQ(nullptr, ++ detail::AllocateAlignedItems(msb, nullptr, nullptr)); ++ EXPECT_EQ(nullptr, ++ detail::AllocateAlignedItems(msb + 1, nullptr, nullptr)); ++ EXPECT_EQ(nullptr, ++ detail::AllocateAlignedItems(msb / 4, nullptr, nullptr)); ++} ++ + TEST(AlignedAllocatorTest, AllocDefaultPointers) { + const size_t kSize = 7777; + void* ptr = AllocateAlignedBytes(kSize, /*alloc_ptr=*/nullptr, + /*opaque_ptr=*/nullptr); + ASSERT_NE(nullptr, ptr); + // Make sure the pointer is actually aligned. +- EXPECT_EQ(0, reinterpret_cast(ptr) % kMaxVectorSize); ++ EXPECT_EQ(0U, reinterpret_cast(ptr) % kMaxVectorSize); + char* p = static_cast(ptr); + size_t ret = 0; + for (size_t i = 0; i < kSize; i++) { +@@ -101,7 +128,7 @@ TEST(AlignedAllocatorTest, AllocDefaultP + p[i] = static_cast(i & 0x7F); + if (i) ret += p[i] * p[i - 1]; + } +- EXPECT_NE(0, ret); ++ EXPECT_NE(0U, ret); + FreeAlignedBytes(ptr, /*free_ptr=*/nullptr, /*opaque_ptr=*/nullptr); + } + +@@ -123,11 +150,11 @@ TEST(AlignedAllocatorTest, CustomAlloc) + AllocateAlignedBytes(kSize, &FakeAllocator::StaticAlloc, &fake_alloc); + ASSERT_NE(nullptr, ptr); + // We should have only requested one alloc from the allocator. +- EXPECT_EQ(1u, fake_alloc.PendingAllocs()); ++ EXPECT_EQ(1U, fake_alloc.PendingAllocs()); + // Make sure the pointer is actually aligned. +- EXPECT_EQ(0, reinterpret_cast(ptr) % kMaxVectorSize); ++ EXPECT_EQ(0U, reinterpret_cast(ptr) % kMaxVectorSize); + FreeAlignedBytes(ptr, &FakeAllocator::StaticFree, &fake_alloc); +- EXPECT_EQ(0u, fake_alloc.PendingAllocs()); ++ EXPECT_EQ(0U, fake_alloc.PendingAllocs()); + } + + TEST(AlignedAllocatorTest, MakeUniqueAlignedDefaultConstructor) { +@@ -170,7 +197,7 @@ TEST(AlignedAllocatorTest, MakeUniqueAli + TEST(AlignedAllocatorTest, AllocSingleInt) { + auto ptr = AllocateAligned(1); + ASSERT_NE(nullptr, ptr.get()); +- EXPECT_EQ(0, reinterpret_cast(ptr.get()) % kMaxVectorSize); ++ EXPECT_EQ(0U, reinterpret_cast(ptr.get()) % kMaxVectorSize); + // Force delete of the unique_ptr now to check that it doesn't crash. + ptr.reset(nullptr); + EXPECT_EQ(nullptr, ptr.get()); +@@ -180,7 +207,7 @@ TEST(AlignedAllocatorTest, AllocMultiple + const size_t kSize = 7777; + auto ptr = AllocateAligned(kSize); + ASSERT_NE(nullptr, ptr.get()); +- EXPECT_EQ(0, reinterpret_cast(ptr.get()) % kMaxVectorSize); ++ EXPECT_EQ(0U, reinterpret_cast(ptr.get()) % kMaxVectorSize); + // ptr[i] is actually (*ptr.get())[i] which will use the operator[] of the + // underlying type chosen by AllocateAligned() for the std::unique_ptr. + EXPECT_EQ(&(ptr[0]) + 1, &(ptr[1])); +@@ -191,7 +218,7 @@ TEST(AlignedAllocatorTest, AllocMultiple + ptr[i] = static_cast(i); + if (i) ret += ptr[i] * ptr[i - 1]; + } +- EXPECT_NE(0, ret); ++ EXPECT_NE(0U, ret); + } + + TEST(AlignedAllocatorTest, AllocateAlignedObjectWithoutDestructor) { +@@ -215,7 +242,8 @@ TEST(AlignedAllocatorTest, MakeUniqueAli + auto arr = MakeUniqueAlignedArrayWithAlloc>( + 7, FakeAllocator::StaticAlloc, FakeAllocator::StaticFree, &fake_alloc, + &counter); +- // An array shold still only call a single allocation. ++ ASSERT_NE(nullptr, arr.get()); ++ // An array should still only call a single allocation. + EXPECT_EQ(1u, fake_alloc.PendingAllocs()); + EXPECT_EQ(7, counter); + for (size_t i = 0; i < 7; i++) { +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/aligned_allocator_test.ccE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/aligned_allocator_test.ccE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/base.h.12 chromium-91.0.4472.77/third_party/highway/src/hwy/base.h +--- chromium-91.0.4472.77/third_party/highway/src/hwy/base.h.12 2021-06-02 10:56:05.266904549 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/base.h 2021-05-31 10:37:11.000000000 -0400 +@@ -34,7 +34,10 @@ + //------------------------------------------------------------------------------ + // Detect compiler using predefined macros + +-#ifdef _MSC_VER ++// clang-cl defines _MSC_VER but doesn't behave like MSVC in other aspects like ++// used in HWY_DIAGNOSTICS(). We include a check that we are not clang for that ++// purpose. ++#if defined(_MSC_VER) && !defined(__clang__) + #define HWY_COMPILER_MSVC _MSC_VER + #else + #define HWY_COMPILER_MSVC 0 +@@ -200,6 +203,10 @@ + #define HWY_ARCH_X86_64 0 + #endif + ++#if HWY_ARCH_X86_32 && HWY_ARCH_X86_64 ++#error "Cannot have both x86-32 and x86-64" ++#endif ++ + #if HWY_ARCH_X86_32 || HWY_ARCH_X86_64 + #define HWY_ARCH_X86 1 + #else +@@ -212,14 +219,29 @@ + #define HWY_ARCH_PPC 0 + #endif + +-#if defined(__arm__) || defined(_M_ARM) || defined(__aarch64__) ++#if defined(__ARM_ARCH_ISA_A64) || defined(__aarch64__) || defined(_M_ARM64) ++#define HWY_ARCH_ARM_A64 1 ++#else ++#define HWY_ARCH_ARM_A64 0 ++#endif ++ ++#if defined(__arm__) || defined(_M_ARM) ++#define HWY_ARCH_ARM_V7 1 ++#else ++#define HWY_ARCH_ARM_V7 0 ++#endif ++ ++#if HWY_ARCH_ARM_A64 && HWY_ARCH_ARM_V7 ++#error "Cannot have both A64 and V7" ++#endif ++ ++#if HWY_ARCH_ARM_A64 || HWY_ARCH_ARM_V7 + #define HWY_ARCH_ARM 1 + #else + #define HWY_ARCH_ARM 0 + #endif + +-// There isn't yet a standard __wasm or __wasm__. +-#ifdef __EMSCRIPTEN__ ++#if defined(__EMSCRIPTEN__) || defined(__wasm__) || defined(__WASM__) + #define HWY_ARCH_WASM 1 + #else + #define HWY_ARCH_WASM 0 +@@ -231,9 +253,11 @@ + #define HWY_ARCH_RVV 0 + #endif + ++// It is an error to detect multiple architectures at the same time, but OK to ++// detect none of the above. + #if (HWY_ARCH_X86 + HWY_ARCH_PPC + HWY_ARCH_ARM + HWY_ARCH_WASM + \ +- HWY_ARCH_RVV) != 1 +-#error "Must detect exactly one platform" ++ HWY_ARCH_RVV) > 1 ++#error "Must not detect more than one architecture" + #endif + + //------------------------------------------------------------------------------ +@@ -308,13 +332,26 @@ static constexpr HWY_MAYBE_UNUSED size_t + // Match [u]int##_t naming scheme so rvv-inl.h macros can obtain the type name + // by concatenating base type and bits. + +-// RVV already has a builtin type. +-#if !HWY_ARCH_RVV ++// RVV already has a builtin type and the GCC intrinsics require it. ++#if HWY_ARCH_RVV && HWY_COMPILER_GCC ++#define HWY_NATIVE_FLOAT16 1 ++#else ++#define HWY_NATIVE_FLOAT16 0 ++#endif ++ ++#if HWY_NATIVE_FLOAT16 ++using float16_t = __fp16; ++// Clang does not allow __fp16 arguments, but scalar.h requires LaneType ++// arguments, so use a wrapper. ++// TODO(janwas): replace with _Float16 when that is supported? ++#else ++#pragma pack(push, 1) + struct float16_t { +- // __fp16 cannot be used as a function parameter in clang, so use a wrapper. + uint16_t bits; + }; ++#pragma pack(pop) + #endif ++ + using float32_t = float; + using float64_t = double; + +@@ -506,6 +543,13 @@ struct Relations { + using Narrow = int32_t; + }; + template <> ++struct Relations { ++ using Unsigned = uint16_t; ++ using Signed = int16_t; ++ using Float = float16_t; ++ using Wide = float; ++}; ++template <> + struct Relations { + using Unsigned = uint32_t; + using Signed = int32_t; +@@ -551,13 +595,13 @@ constexpr inline size_t RoundUpTo(size_t + + // Undefined results for x == 0. + HWY_API size_t Num0BitsBelowLS1Bit_Nonzero32(const uint32_t x) { +-#ifdef _MSC_VER ++#if HWY_COMPILER_MSVC + unsigned long index; // NOLINT + _BitScanForward(&index, x); + return index; +-#else ++#else // HWY_COMPILER_MSVC + return static_cast(__builtin_ctz(x)); +-#endif ++#endif // HWY_COMPILER_MSVC + } + + HWY_API size_t PopCount(uint64_t x) { +@@ -565,7 +609,7 @@ HWY_API size_t PopCount(uint64_t x) { + return static_cast(__builtin_popcountll(x)); + #elif HWY_COMPILER_MSVC && HWY_ARCH_X86_64 + return _mm_popcnt_u64(x); +-#elif HWY_COMPILER_MSVC ++#elif HWY_COMPILER_MSVC && HWY_ARCH_X86_32 + return _mm_popcnt_u32(uint32_t(x)) + _mm_popcnt_u32(uint32_t(x >> 32)); + #else + x -= ((x >> 1) & 0x55555555U); +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/base.hE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/base.hE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/cache_control.h.12 chromium-91.0.4472.77/third_party/highway/src/hwy/cache_control.h +--- chromium-91.0.4472.77/third_party/highway/src/hwy/cache_control.h.12 2021-06-02 10:56:05.280904620 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/cache_control.h 2021-05-31 10:37:11.000000000 -0400 +@@ -20,7 +20,9 @@ + + #include "hwy/base.h" + +-#ifndef __SSE2__ ++// Requires SSE2; fails to compile on 32-bit Clang 7 (see ++// https://github.com/gperftools/gperftools/issues/946). ++#if !defined(__SSE2__) || (HWY_COMPILER_CLANG && HWY_ARCH_X86_32) + #undef HWY_DISABLE_CACHE_CONTROL + #define HWY_DISABLE_CACHE_CONTROL + #endif +@@ -30,6 +32,14 @@ + #include // SSE2 + #endif + ++// Windows.h #defines these, which causes infinite recursion. Temporarily ++// undefine them in this header; these functions are anyway deprecated. ++// TODO(janwas): remove when these functions are removed. ++#pragma push_macro("LoadFence") ++#pragma push_macro("StoreFence") ++#undef LoadFence ++#undef StoreFence ++ + namespace hwy { + + // Even if N*sizeof(T) is smaller, Stream may write a multiple of this size. +@@ -81,6 +91,17 @@ HWY_INLINE HWY_ATTR_CACHE void FlushCach + #endif + } + ++// Reduces power consumption in spin-loops. No effect on non-x86. ++HWY_INLINE HWY_ATTR_CACHE void Pause() { ++#if HWY_ARCH_X86 && !defined(HWY_DISABLE_CACHE_CONTROL) ++ _mm_pause(); ++#endif ++} ++ + } // namespace hwy + ++// TODO(janwas): remove when these functions are removed. (See above.) ++#pragma pop_macro("StoreFence") ++#pragma pop_macro("LoadFence") ++ + #endif // HIGHWAY_HWY_CACHE_CONTROL_H_ +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/cache_control.hE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/cache_control.hE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/examples/benchmark.cc.12 chromium-91.0.4472.77/third_party/highway/src/hwy/examples/benchmark.cc +--- chromium-91.0.4472.77/third_party/highway/src/hwy/examples/benchmark.cc.12 2021-06-02 10:56:05.195904190 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/examples/benchmark.cc 2021-05-31 10:37:11.000000000 -0400 +@@ -19,7 +19,6 @@ + #include + #include + +-#include + #include + #include // iota + +@@ -37,15 +36,15 @@ using hwy::HWY_NAMESPACE::CombineShiftRi + + class TwoArray { + public: +- // Passed to ctor as a value NOT known to the compiler. Must be a multiple of +- // the vector lane count * 8. ++ // Must be a multiple of the vector lane count * 8. + static size_t NumItems() { return 3456; } + +- explicit TwoArray(const size_t num_items) +- : a_(AllocateAligned(num_items * 2)), b_(a_.get() + num_items) { +- const float init = num_items / NumItems(); // 1, but compiler doesn't know +- std::iota(a_.get(), a_.get() + num_items, init); +- std::iota(b_, b_ + num_items, init); ++ TwoArray() ++ : a_(AllocateAligned(NumItems() * 2)), b_(a_.get() + NumItems()) { ++ // = 1, but compiler doesn't know ++ const float init = static_cast(Unpredictable1()); ++ std::iota(a_.get(), a_.get() + NumItems(), init); ++ std::iota(b_, b_ + NumItems(), init); + } + + protected: +@@ -62,7 +61,7 @@ void RunBenchmark(const char* caption) { + const FuncInput inputs[kNumInputs] = {num_items}; + Result results[kNumInputs]; + +- Benchmark benchmark(num_items); ++ Benchmark benchmark; + + Params p; + p.verbose = false; +@@ -101,7 +100,7 @@ void Intro() { + // 0.4 cyc/float = bronze, 0.25 = silver, 0.15 = gold! + class BenchmarkDot : public TwoArray { + public: +- explicit BenchmarkDot(size_t num_items) : TwoArray(num_items), dot_{-1.0f} {} ++ BenchmarkDot() : dot_{-1.0f} {} + + FuncOutput operator()(const size_t num_items) { + HWY_FULL(float) d; +@@ -132,7 +131,8 @@ class BenchmarkDot : public TwoArray { + sum[i] += sum[i + power]; + } + } +- return dot_ = GetLane(SumOfLanes(sum[0])); ++ dot_ = GetLane(SumOfLanes(sum[0])); ++ return static_cast(dot_); + } + void Verify(size_t num_items) { + if (dot_ == -1.0f) { +@@ -157,8 +157,6 @@ class BenchmarkDot : public TwoArray { + // INTERMEDIATE: delta coding + // 1.0 cycles/float = bronze, 0.7 = silver, 0.4 = gold! + struct BenchmarkDelta : public TwoArray { +- explicit BenchmarkDelta(size_t num_items) : TwoArray(num_items) {} +- + FuncOutput operator()(const size_t num_items) const { + #if HWY_TARGET == HWY_SCALAR + b_[0] = a_[0]; +@@ -197,7 +195,7 @@ struct BenchmarkDelta : public TwoArray + Store(a - shifted, df, &b_[i]); + } + #endif +- return b_[num_items - 1]; ++ return static_cast(b_[num_items - 1]); + } + + void Verify(size_t num_items) { +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/examples/benchmark.ccE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/examples/benchmark.ccE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton.cc.12 chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton.cc +--- chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton.cc.12 2021-06-02 10:56:05.189904159 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton.cc 2021-05-31 10:37:11.000000000 -0400 +@@ -22,27 +22,62 @@ + // For runtime dispatch, specify the name of the current file (unfortunately + // __FILE__ is not reliable) so that foreach_target.h can re-include it. + #define HWY_TARGET_INCLUDE "hwy/examples/skeleton.cc" +-// Re-include this file once per enabled target to generate code for it. ++// Generates code for each enabled target by re-including this source file. + #include "hwy/foreach_target.h" + +-#include "hwy/examples/skeleton_shared.h" + #include "hwy/highway.h" + +-// Optional: factor out parts of the implementation into *-inl.h +-#include "hwy/examples/skeleton-inl.h" +- + // Optional, can instead add HWY_ATTR to all functions. + HWY_BEFORE_NAMESPACE(); + namespace skeleton { + namespace HWY_NAMESPACE { + +-// Compiled once per target via multiple inclusion. +-void Skeleton(const float* HWY_RESTRICT in1, const float* HWY_RESTRICT in2, +- float* HWY_RESTRICT out) { +- printf("Target %s: %s\n", hwy::TargetName(HWY_TARGET), +- ExampleGatherStrategy()); ++// Highway ops reside here; ADL does not find templates nor builtins. ++using namespace hwy::HWY_NAMESPACE; ++ ++// Computes log2 by converting to a vector of floats. Compiled once per target. ++template ++HWY_NOINLINE void OneFloorLog2(const DF df, const uint8_t* HWY_RESTRICT values, ++ uint8_t* HWY_RESTRICT log2) { ++ // Type tags for converting to other element types (Rebind = same count). ++ const Rebind d32; ++ const Rebind d8; ++ ++ const auto u8 = Load(d8, values); ++ const auto bits = BitCast(d32, ConvertTo(df, PromoteTo(d32, u8))); ++ const auto exponent = ShiftRight<23>(bits) - Set(d32, 127); ++ Store(DemoteTo(d8, exponent), d8, log2); ++} ++ ++HWY_NOINLINE void CodepathDemo() { ++ // Highway defaults to portability, but per-target codepaths may be selected ++ // via #if HWY_TARGET == HWY_SSE4 or by testing capability macros: ++#if HWY_CAP_INTEGER64 ++ const char* gather = "Has int64"; ++#else ++ const char* gather = "No int64"; ++#endif ++ printf("Target %s: %s\n", hwy::TargetName(HWY_TARGET), gather); ++} + +- ExampleMulAdd(in1, in2, out); ++HWY_NOINLINE void FloorLog2(const uint8_t* HWY_RESTRICT values, size_t count, ++ uint8_t* HWY_RESTRICT log2) { ++ CodepathDemo(); ++ ++ // Second argument is necessary on RVV until it supports fractional lengths. ++ HWY_FULL(float, 4) df; ++ ++ const size_t N = Lanes(df); ++ size_t i = 0; ++ for (; i + N <= count; i += N) { ++ OneFloorLog2(df, values + i, log2 + i); ++ } ++ // TODO(janwas): implement ++#if HWY_TARGET != HWY_RVV ++ for (; i < count; ++i) { ++ OneFloorLog2(HWY_CAPPED(float, 1)(), values + i, log2 + i); ++ } ++#endif + } + + // NOLINTNEXTLINE(google-readability-namespace-comments) +@@ -54,22 +89,20 @@ HWY_AFTER_NAMESPACE(); + + namespace skeleton { + +-// This macro declares a static array SkeletonHighwayDispatchTable used for +-// dynamic dispatch. This macro should be placed in the same namespace that +-// defines the Skeleton function above. +-HWY_EXPORT(Skeleton); ++// This macro declares a static array used for dynamic dispatch; it resides in ++// the same outer namespace that contains FloorLog2. ++HWY_EXPORT(FloorLog2); + + // This function is optional and only needed in the case of exposing it in the +-// header file. Otherwise using HWY_DYNAMIC_DISPATCH(Skeleton) multiple times in +-// this module is equivalent to inlining this optional function.. +-void Skeleton(const float* HWY_RESTRICT in1, const float* HWY_RESTRICT in2, +- float* HWY_RESTRICT out) { +- return HWY_DYNAMIC_DISPATCH(Skeleton)(in1, in2, out); ++// header file. Otherwise using HWY_DYNAMIC_DISPATCH(FloorLog2) in this module ++// is equivalent to inlining this function. ++void CallFloorLog2(const uint8_t* HWY_RESTRICT in, const size_t count, ++ uint8_t* HWY_RESTRICT out) { ++ return HWY_DYNAMIC_DISPATCH(FloorLog2)(in, count, out); + } + + // Optional: anything to compile only once, e.g. non-SIMD implementations of +-// public functions provided by this module, can go inside #if HWY_ONCE +-// (after end_target-inl.h). ++// public functions provided by this module, can go inside #if HWY_ONCE. + + } // namespace skeleton + #endif // HWY_ONCE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton.ccE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton.ccE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton.h.12 chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton.h +--- chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton.h.12 2021-06-02 10:56:05.213904281 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton.h 2021-05-31 10:37:11.000000000 -0400 +@@ -18,15 +18,17 @@ + #ifndef HIGHWAY_HWY_EXAMPLES_SKELETON_H_ + #define HIGHWAY_HWY_EXAMPLES_SKELETON_H_ + +-// Tiny subset of Highway API: essentials for declaring an interface, without +-// any implementation details. ++#include ++ ++// Platform-specific definitions used for declaring an interface, independent of ++// the SIMD instruction set. + #include "hwy/base.h" // HWY_RESTRICT + + namespace skeleton { + +-// Computes out[i] = in1[i] * kMultiplier + in2[i] for i < 256. +-void Skeleton(const float* HWY_RESTRICT in1, const float* HWY_RESTRICT in2, +- float* HWY_RESTRICT out); ++// Computes base-2 logarithm by converting to float. Supports dynamic dispatch. ++void CallFloorLog2(const uint8_t* HWY_RESTRICT in, const size_t count, ++ uint8_t* HWY_RESTRICT out); + + } // namespace skeleton + +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton.hE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton.hE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton-inl.h.12 chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton-inl.h +--- chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton-inl.h.12 2021-06-02 10:56:05.164904033 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton-inl.h 2021-05-31 10:37:11.000000000 -0400 +@@ -29,41 +29,31 @@ + // It is fine to #include normal or *-inl headers. + #include + +-#include "hwy/examples/skeleton_shared.h" + #include "hwy/highway.h" + + HWY_BEFORE_NAMESPACE(); + namespace skeleton { + namespace HWY_NAMESPACE { + +-using hwy::HWY_NAMESPACE::MulAdd; ++using namespace hwy::HWY_NAMESPACE; + +-// Computes out[i] = in1[i] * kMultiplier + in2[i] for i < 256. +-HWY_MAYBE_UNUSED void ExampleMulAdd(const float* HWY_RESTRICT in1, +- const float* HWY_RESTRICT in2, +- float* HWY_RESTRICT out) { +- // Descriptor(s) for all vector types used in this function. +- HWY_FULL(float) df; +- +- const auto mul = Set(df, kMultiplier); +- for (size_t i = 0; i < 256; i += Lanes(df)) { +- const auto result = MulAdd(mul, Load(df, in1 + i), Load(df, in2 + i)); +- Store(result, df, out + i); ++// Example of a type-agnostic (caller-specified lane type) and width-agnostic ++// (uses best available instruction set) function in a header. ++// ++// Computes x[i] = mul_array[i] * x_array[i] + add_array[i] for i < size. ++template ++HWY_MAYBE_UNUSED void MulAddLoop(const D d, const T* HWY_RESTRICT mul_array, ++ const T* HWY_RESTRICT add_array, ++ const size_t size, T* HWY_RESTRICT x_array) { ++ for (size_t i = 0; i < size; i += Lanes(d)) { ++ const auto mul = Load(d, mul_array + i); ++ const auto add = Load(d, add_array + i); ++ auto x = Load(d, x_array + i); ++ x = MulAdd(mul, x, add); ++ Store(x, d, x_array + i); + } + } + +-// (This doesn't generate SIMD instructions, so is not required here) +-HWY_MAYBE_UNUSED const char* ExampleGatherStrategy() { +- // Highway functions generate per-target implementations from the same source +- // code via HWY_CAPPED(type, HWY_MIN(any_LANES_constants, ..)). If needed, +- // entirely different codepaths can also be selected like so: +-#if HWY_GATHER_LANES > 1 +- return "Has gather"; +-#else +- return "Gather is limited to one lane"; +-#endif +-} +- + // NOLINTNEXTLINE(google-readability-namespace-comments) + } // namespace HWY_NAMESPACE + } // namespace skeleton +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton-inl.hE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton-inl.hE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton_main.cc.12 chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton_main.cc +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton_main.ccE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton_main.ccE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton_shared.h.12 chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton_shared.h +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton_shared.hE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton_shared.hE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton_static.cc.12 chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton_static.cc +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton_static.ccE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton_static.ccE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton_static_main.cc.12 chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton_static_main.cc +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton_static_main.ccE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton_static_main.ccE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton_test.cc.12 chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton_test.cc +--- chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton_test.cc.12 2021-06-02 10:56:05.170904063 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton_test.cc 2021-05-31 10:37:11.000000000 -0400 +@@ -12,30 +12,96 @@ + // See the License for the specific language governing permissions and + // limitations under the License. + +-// Example of unit test for the "skeleton" module. ++// Example of unit test for the "skeleton" library. + +-#include "hwy/examples/skeleton.h" // Skeleton ++#include "hwy/examples/skeleton.h" + + #include + +-#include "hwy/tests/test_util-inl.h" // RunTest ++#undef HWY_TARGET_INCLUDE ++#define HWY_TARGET_INCLUDE "examples/skeleton_test.cc" ++#include "hwy/foreach_target.h" ++#include "hwy/highway.h" ++#include "hwy/tests/test_util-inl.h" + ++// Optional: factor out parts of the implementation into *-inl.h ++#include "hwy/examples/skeleton-inl.h" ++ ++HWY_BEFORE_NAMESPACE(); + namespace skeleton { ++namespace HWY_NAMESPACE { ++ ++using namespace hwy::HWY_NAMESPACE; ++ ++// Calls function defined in skeleton.cc. ++struct TestFloorLog2 { ++ template ++ HWY_NOINLINE void operator()(T /*unused*/, DF df) { ++ const size_t count = 5 * Lanes(df); ++ auto in = hwy::AllocateAligned(count); ++ auto expected = hwy::AllocateAligned(count); ++ ++ hwy::RandomState rng; ++ for (size_t i = 0; i < count; ++i) { ++ expected[i] = Random32(&rng) & 7; ++ in[i] = static_cast(1u << expected[i]); ++ } ++ auto out = hwy::AllocateAligned(count); ++ CallFloorLog2(in.get(), count, out.get()); ++ int sum = 0; ++ for (size_t i = 0; i < count; ++i) { ++ // TODO(janwas): implement ++#if HWY_TARGET != HWY_RVV ++ HWY_ASSERT_EQ(expected[i], out[i]); ++#endif ++ sum += out[i]; ++ } ++ hwy::PreventElision(sum); ++ } ++}; ++ ++HWY_NOINLINE void TestAllFloorLog2() { ++ ForPartialVectors()(float()); ++} ++ ++// Calls function defined in skeleton-inl.h. ++struct TestSumMulAdd { ++ template ++ HWY_NOINLINE void operator()(T /*unused*/, D d) { ++ hwy::RandomState rng; ++ const size_t count = 4096; ++ EXPECT_TRUE(count % Lanes(d) == 0); ++ auto mul = hwy::AllocateAligned(count); ++ auto x = hwy::AllocateAligned(count); ++ auto add = hwy::AllocateAligned(count); ++ for (size_t i = 0; i < count; ++i) { ++ mul[i] = static_cast(Random32(&rng) & 0xF); ++ x[i] = static_cast(Random32(&rng) & 0xFF); ++ add[i] = static_cast(Random32(&rng) & 0xFF); ++ } ++ double expected_sum = 0.0; ++ for (size_t i = 0; i < count; ++i) { ++ expected_sum += mul[i] * x[i] + add[i]; ++ } + +-TEST(SkeletonTest, MainTest) { +- HWY_ALIGN_MAX float in1[256]; +- HWY_ALIGN_MAX float in2[256]; +- HWY_ALIGN_MAX float out[256]; +- for (size_t i = 0; i < 256; ++i) { +- in1[i] = static_cast(i); +- in2[i] = in1[i] + 300; ++ MulAddLoop(d, mul.get(), add.get(), count, x.get()); ++ HWY_ASSERT_EQ(4344240.0, expected_sum); + } ++}; + +- // Tests will run for all compiled targets to ensure all are OK. +- hwy::RunTest([&in1, &in2, &out]() { +- Skeleton(in1, in2, out); +- // Add EXPECT_... calls here. +- }); ++HWY_NOINLINE void TestAllSumMulAdd() { ++ ForFloatTypes(ForPartialVectors()); + } + ++// NOLINTNEXTLINE(google-readability-namespace-comments) ++} // namespace HWY_NAMESPACE ++} // namespace skeleton ++HWY_AFTER_NAMESPACE(); ++ ++#if HWY_ONCE ++namespace skeleton { ++HWY_BEFORE_TEST(SkeletonTest); ++HWY_EXPORT_AND_TEST_P(SkeletonTest, TestAllFloorLog2); ++HWY_EXPORT_AND_TEST_P(SkeletonTest, TestAllSumMulAdd); + } // namespace skeleton ++#endif +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton_test.ccE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/examples/skeleton_test.ccE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/foreach_target.h.12 chromium-91.0.4472.77/third_party/highway/src/hwy/foreach_target.h +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/foreach_target.hE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/foreach_target.hE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/highway.h.12 chromium-91.0.4472.77/third_party/highway/src/hwy/highway.h +--- chromium-91.0.4472.77/third_party/highway/src/hwy/highway.h.12 2021-06-02 10:56:05.269904564 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/highway.h 2021-05-31 10:37:11.000000000 -0400 +@@ -25,10 +25,10 @@ + + namespace hwy { + +-// API version (https://semver.org/) ++// API version (https://semver.org/); keep in sync with CMakeLists.txt. + #define HWY_MAJOR 0 +-#define HWY_MINOR 11 +-#define HWY_PATCH 1 ++#define HWY_MINOR 12 ++#define HWY_PATCH 2 + + //------------------------------------------------------------------------------ + // Shorthand for descriptors (defined in shared-inl.h) used to select overloads. +@@ -49,7 +49,7 @@ namespace hwy { + HWY_FULL_RECOMPOSER((__VA_ARGS__, HWY_FULL2, HWY_FULL1, )) + #define HWY_FULL(...) HWY_CHOOSE_FULL(__VA_ARGS__())(__VA_ARGS__) + +-// Vector of up to MAX_N lanes. ++// Vector of up to MAX_N lanes. Discouraged, when possible, use Half<> instead. + #define HWY_CAPPED(T, MAX_N) \ + hwy::HWY_NAMESPACE::Simd + +@@ -75,6 +75,10 @@ namespace hwy { + #define HWY_STATIC_DISPATCH(FUNC_NAME) N_WASM::FUNC_NAME + #elif HWY_STATIC_TARGET == HWY_NEON + #define HWY_STATIC_DISPATCH(FUNC_NAME) N_NEON::FUNC_NAME ++#elif HWY_STATIC_TARGET == HWY_SVE ++#define HWY_STATIC_DISPATCH(FUNC_NAME) N_SVE::FUNC_NAME ++#elif HWY_STATIC_TARGET == HWY_SVE2 ++#define HWY_STATIC_DISPATCH(FUNC_NAME) N_SVE2::FUNC_NAME + #elif HWY_STATIC_TARGET == HWY_PPC8 + #define HWY_STATIC_DISPATCH(FUNC_NAME) N_PPC8::FUNC_NAME + #elif HWY_STATIC_TARGET == HWY_SSE4 +@@ -143,6 +147,18 @@ FunctionCache Function + #define HWY_CHOOSE_NEON(FUNC_NAME) nullptr + #endif + ++#if HWY_TARGETS & HWY_SVE ++#define HWY_CHOOSE_SVE(FUNC_NAME) &N_SVE::FUNC_NAME ++#else ++#define HWY_CHOOSE_SVE(FUNC_NAME) nullptr ++#endif ++ ++#if HWY_TARGETS & HWY_SVE2 ++#define HWY_CHOOSE_SVE2(FUNC_NAME) &N_SVE2::FUNC_NAME ++#else ++#define HWY_CHOOSE_SVE2(FUNC_NAME) nullptr ++#endif ++ + #if HWY_TARGETS & HWY_PPC8 + #define HWY_CHOOSE_PCC8(FUNC_NAME) &N_PPC8::FUNC_NAME + #else +@@ -261,8 +277,11 @@ FunctionCache Function + #elif HWY_TARGET == HWY_AVX3 + #include "hwy/ops/x86_512-inl.h" + #elif HWY_TARGET == HWY_PPC8 ++#error "PPC is not yet supported" + #elif HWY_TARGET == HWY_NEON + #include "hwy/ops/arm_neon-inl.h" ++#elif HWY_TARGET == HWY_SVE || HWY_TARGET == HWY_SVE2 ++#include "hwy/ops/arm_sve-inl.h" + #elif HWY_TARGET == HWY_WASM + #include "hwy/ops/wasm_128-inl.h" + #elif HWY_TARGET == HWY_RVV +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/highway.hE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/highway.hE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/nanobenchmark.cc.12 chromium-91.0.4472.77/third_party/highway/src/hwy/nanobenchmark.cc +--- chromium-91.0.4472.77/third_party/highway/src/hwy/nanobenchmark.cc.12 2021-06-02 10:56:05.276904599 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/nanobenchmark.cc 2021-05-31 10:37:11.000000000 -0400 +@@ -29,128 +29,43 @@ + #include + #include + ++#if defined(_WIN32) || defined(_WIN64) ++#ifndef NOMINMAX ++#define NOMINMAX ++#endif // NOMINMAX ++#include ++#endif ++ ++#if defined(__MACH__) ++#include ++#include ++#endif ++ ++#if defined(__HAIKU__) ++#include ++#endif ++ + #include "hwy/base.h" + #if HWY_ARCH_PPC + #include // NOLINT __ppc_get_timebase_freq + #elif HWY_ARCH_X86 + +-#ifdef _MSC_VER ++#if HWY_COMPILER_MSVC + #include + #else + #include // NOLINT +-#endif // _MSC_VER ++#endif // HWY_COMPILER_MSVC + + #endif // HWY_ARCH_X86 + + namespace hwy { +-namespace platform { +-namespace { +- +-#if HWY_ARCH_X86 +- +-void Cpuid(const uint32_t level, const uint32_t count, +- uint32_t* HWY_RESTRICT abcd) { +-#if HWY_COMPILER_MSVC +- int regs[4]; +- __cpuidex(regs, level, count); +- for (int i = 0; i < 4; ++i) { +- abcd[i] = regs[i]; +- } +-#else +- uint32_t a; +- uint32_t b; +- uint32_t c; +- uint32_t d; +- __cpuid_count(level, count, a, b, c, d); +- abcd[0] = a; +- abcd[1] = b; +- abcd[2] = c; +- abcd[3] = d; +-#endif +-} +- +-std::string BrandString() { +- char brand_string[49]; +- std::array abcd; +- +- // Check if brand string is supported (it is on all reasonable Intel/AMD) +- Cpuid(0x80000000U, 0, abcd.data()); +- if (abcd[0] < 0x80000004U) { +- return std::string(); +- } +- +- for (size_t i = 0; i < 3; ++i) { +- Cpuid(0x80000002U + i, 0, abcd.data()); +- memcpy(brand_string + i * 16, abcd.data(), sizeof(abcd)); +- } +- brand_string[48] = 0; +- return brand_string; +-} +- +-// Returns the frequency quoted inside the brand string. This does not +-// account for throttling nor Turbo Boost. +-double NominalClockRate() { +- const std::string& brand_string = BrandString(); +- // Brand strings include the maximum configured frequency. These prefixes are +- // defined by Intel CPUID documentation. +- const char* prefixes[3] = {"MHz", "GHz", "THz"}; +- const double multipliers[3] = {1E6, 1E9, 1E12}; +- for (size_t i = 0; i < 3; ++i) { +- const size_t pos_prefix = brand_string.find(prefixes[i]); +- if (pos_prefix != std::string::npos) { +- const size_t pos_space = brand_string.rfind(' ', pos_prefix - 1); +- if (pos_space != std::string::npos) { +- const std::string digits = +- brand_string.substr(pos_space + 1, pos_prefix - pos_space - 1); +- return std::stod(digits) * multipliers[i]; +- } +- } +- } +- +- return 0.0; +-} +- +-#endif // HWY_ARCH_X86 +- +-} // namespace +- +-// Returns tick rate. Invariant means the tick counter frequency is independent +-// of CPU throttling or sleep. May be expensive, caller should cache the result. +-double InvariantTicksPerSecond() { +-#if HWY_ARCH_PPC +- return __ppc_get_timebase_freq(); +-#elif HWY_ARCH_X86 +- // We assume the TSC is invariant; it is on all recent Intel/AMD CPUs. +- return NominalClockRate(); +-#else +- // Fall back to clock_gettime nanoseconds. +- return 1E9; +-#endif +-} +- +-} // namespace platform + namespace { +- +-// Prevents the compiler from eliding the computations that led to "output". +-template +-inline void PreventElision(T&& output) { +-#if HWY_COMPILER_MSVC == 0 +- // Works by indicating to the compiler that "output" is being read and +- // modified. The +r constraint avoids unnecessary writes to memory, but only +- // works for built-in types (typically FuncOutput). +- asm volatile("" : "+r"(output) : : "memory"); +-#else +- // MSVC does not support inline assembly anymore (and never supported GCC's +- // RTL constraints). Self-assignment with #pragma optimize("off") might be +- // expected to prevent elision, but it does not with MSVC 2015. Type-punning +- // with volatile pointers generates inefficient code on MSVC 2017. +- static std::atomic dummy(T{}); +- dummy.store(output, std::memory_order_relaxed); +-#endif +-} +- + namespace timer { + ++// Ticks := platform-specific timer values (CPU cycles on x86). Must be ++// unsigned to guarantee wraparound on overflow. ++using Ticks = uint64_t; ++ + // Start/Stop return absolute timestamps and must be placed immediately before + // and after the region to measure. We provide separate Start/Stop functions + // because they use different fences. +@@ -202,8 +117,8 @@ namespace timer { + + // Returns a 64-bit timestamp in unit of 'ticks'; to convert to seconds, + // divide by InvariantTicksPerSecond. +-inline uint64_t Start64() { +- uint64_t t; ++inline Ticks Start() { ++ Ticks t; + #if HWY_ARCH_PPC + asm volatile("mfspr %0, %1" : "=r"(t) : "i"(268)); + #elif HWY_ARCH_X86 && HWY_COMPILER_MSVC +@@ -228,8 +143,15 @@ inline uint64_t Start64() { + : "rdx", "memory", "cc"); + #elif HWY_ARCH_RVV + asm volatile("rdcycle %0" : "=r"(t)); +-#else +- // Fall back to OS - unsure how to reliably query cntvct_el0 frequency. ++#elif defined(_WIN32) || defined(_WIN64) ++ LARGE_INTEGER counter; ++ (void)QueryPerformanceCounter(&counter); ++ t = counter.QuadPart; ++#elif defined(__MACH__) ++ t = mach_absolute_time(); ++#elif defined(__HAIKU__) ++ t = system_time_nsecs(); // since boot ++#else // POSIX + timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + t = ts.tv_sec * 1000000000LL + ts.tv_nsec; +@@ -237,7 +159,7 @@ inline uint64_t Start64() { + return t; + } + +-inline uint64_t Stop64() { ++inline Ticks Stop() { + uint64_t t; + #if HWY_ARCH_PPC + asm volatile("mfspr %0, %1" : "=r"(t) : "i"(268)); +@@ -261,61 +183,7 @@ inline uint64_t Stop64() { + // "cc" = flags modified by SHL. + : "rcx", "rdx", "memory", "cc"); + #else +- t = Start64(); +-#endif +- return t; +-} +- +-// Returns a 32-bit timestamp with about 4 cycles less overhead than +-// Start64. Only suitable for measuring very short regions because the +-// timestamp overflows about once a second. +-inline uint32_t Start32() { +- uint32_t t; +-#if HWY_ARCH_X86 && HWY_COMPILER_MSVC +- _ReadWriteBarrier(); +- _mm_lfence(); +- _ReadWriteBarrier(); +- t = static_cast(__rdtsc()); +- _ReadWriteBarrier(); +- _mm_lfence(); +- _ReadWriteBarrier(); +-#elif HWY_ARCH_X86_64 +- asm volatile( +- "lfence\n\t" +- "rdtsc\n\t" +- "lfence" +- : "=a"(t) +- : +- // "memory" avoids reordering. rdx = TSC >> 32. +- : "rdx", "memory"); +-#elif HWY_ARCH_RVV +- asm volatile("rdcycle %0" : "=r"(t)); +-#else +- t = static_cast(Start64()); +-#endif +- return t; +-} +- +-inline uint32_t Stop32() { +- uint32_t t; +-#if HWY_ARCH_X86 && HWY_COMPILER_MSVC +- _ReadWriteBarrier(); +- unsigned aux; +- t = static_cast(__rdtscp(&aux)); +- _ReadWriteBarrier(); +- _mm_lfence(); +- _ReadWriteBarrier(); +-#elif HWY_ARCH_X86_64 +- // Use inline asm because __rdtscp generates code to store TSC_AUX (ecx). +- asm volatile( +- "rdtscp\n\t" +- "lfence" +- : "=a"(t) +- : +- // "memory" avoids reordering. rcx = TSC_AUX. rdx = TSC >> 32. +- : "rcx", "rdx", "memory"); +-#else +- t = static_cast(Stop64()); ++ t = Start(); + #endif + return t; + } +@@ -440,21 +308,130 @@ T MedianAbsoluteDeviation(const T* value + } + + } // namespace robust_statistics ++} // namespace ++namespace platform { ++namespace { + +-// Ticks := platform-specific timer values (CPU cycles on x86). Must be +-// unsigned to guarantee wraparound on overflow. 32 bit timers are faster to +-// read than 64 bit. +-using Ticks = uint32_t; ++// Prevents the compiler from eliding the computations that led to "output". ++template ++inline void PreventElision(T&& output) { ++#if HWY_COMPILER_MSVC == 0 ++ // Works by indicating to the compiler that "output" is being read and ++ // modified. The +r constraint avoids unnecessary writes to memory, but only ++ // works for built-in types (typically FuncOutput). ++ asm volatile("" : "+r"(output) : : "memory"); ++#else ++ // MSVC does not support inline assembly anymore (and never supported GCC's ++ // RTL constraints). Self-assignment with #pragma optimize("off") might be ++ // expected to prevent elision, but it does not with MSVC 2015. Type-punning ++ // with volatile pointers generates inefficient code on MSVC 2017. ++ static std::atomic dummy(T{}); ++ dummy.store(output, std::memory_order_relaxed); ++#endif ++} ++ ++#if HWY_ARCH_X86 ++ ++void Cpuid(const uint32_t level, const uint32_t count, ++ uint32_t* HWY_RESTRICT abcd) { ++#if HWY_COMPILER_MSVC ++ int regs[4]; ++ __cpuidex(regs, level, count); ++ for (int i = 0; i < 4; ++i) { ++ abcd[i] = regs[i]; ++ } ++#else ++ uint32_t a; ++ uint32_t b; ++ uint32_t c; ++ uint32_t d; ++ __cpuid_count(level, count, a, b, c, d); ++ abcd[0] = a; ++ abcd[1] = b; ++ abcd[2] = c; ++ abcd[3] = d; ++#endif ++} ++ ++std::string BrandString() { ++ char brand_string[49]; ++ std::array abcd; ++ ++ // Check if brand string is supported (it is on all reasonable Intel/AMD) ++ Cpuid(0x80000000U, 0, abcd.data()); ++ if (abcd[0] < 0x80000004U) { ++ return std::string(); ++ } ++ ++ for (size_t i = 0; i < 3; ++i) { ++ Cpuid(static_cast(0x80000002U + i), 0, abcd.data()); ++ memcpy(brand_string + i * 16, abcd.data(), sizeof(abcd)); ++ } ++ brand_string[48] = 0; ++ return brand_string; ++} ++ ++// Returns the frequency quoted inside the brand string. This does not ++// account for throttling nor Turbo Boost. ++double NominalClockRate() { ++ const std::string& brand_string = BrandString(); ++ // Brand strings include the maximum configured frequency. These prefixes are ++ // defined by Intel CPUID documentation. ++ const char* prefixes[3] = {"MHz", "GHz", "THz"}; ++ const double multipliers[3] = {1E6, 1E9, 1E12}; ++ for (size_t i = 0; i < 3; ++i) { ++ const size_t pos_prefix = brand_string.find(prefixes[i]); ++ if (pos_prefix != std::string::npos) { ++ const size_t pos_space = brand_string.rfind(' ', pos_prefix - 1); ++ if (pos_space != std::string::npos) { ++ const std::string digits = ++ brand_string.substr(pos_space + 1, pos_prefix - pos_space - 1); ++ return std::stod(digits) * multipliers[i]; ++ } ++ } ++ } ++ ++ return 0.0; ++} ++ ++#endif // HWY_ARCH_X86 ++ ++} // namespace ++ ++double InvariantTicksPerSecond() { ++#if HWY_ARCH_PPC ++ return __ppc_get_timebase_freq(); ++#elif HWY_ARCH_X86 ++ // We assume the TSC is invariant; it is on all recent Intel/AMD CPUs. ++ return NominalClockRate(); ++#elif defined(_WIN32) || defined(_WIN64) ++ LARGE_INTEGER freq; ++ (void)QueryPerformanceFrequency(&freq); ++ return double(freq.QuadPart); ++#elif defined(__MACH__) ++ // https://developer.apple.com/library/mac/qa/qa1398/_index.html ++ mach_timebase_info_data_t timebase; ++ (void)mach_timebase_info(&timebase); ++ return double(timebase.denom) / timebase.numer * 1E9; ++#else ++ // TODO(janwas): ARM? Unclear how to reliably query cntvct_el0 frequency. ++ return 1E9; // Haiku and clock_gettime return nanoseconds. ++#endif ++} + +-// Returns timer overhead / minimum measurable difference. +-Ticks TimerResolution() { ++double Now() { ++ static const double mul = 1.0 / InvariantTicksPerSecond(); ++ return static_cast(timer::Start()) * mul; ++} ++ ++uint64_t TimerResolution() { + // Nested loop avoids exceeding stack/L1 capacity. +- Ticks repetitions[Params::kTimerSamples]; ++ timer::Ticks repetitions[Params::kTimerSamples]; + for (size_t rep = 0; rep < Params::kTimerSamples; ++rep) { +- Ticks samples[Params::kTimerSamples]; ++ timer::Ticks samples[Params::kTimerSamples]; + for (size_t i = 0; i < Params::kTimerSamples; ++i) { +- const Ticks t0 = timer::Start32(); +- const Ticks t1 = timer::Stop32(); ++ const timer::Ticks t0 = timer::Start(); ++ const timer::Ticks t1 = timer::Stop(); + samples[i] = t1 - t0; + } + repetitions[rep] = robust_statistics::Mode(samples); +@@ -462,18 +439,21 @@ Ticks TimerResolution() { + return robust_statistics::Mode(repetitions); + } + +-static const Ticks timer_resolution = TimerResolution(); ++} // namespace platform ++namespace { ++ ++static const timer::Ticks timer_resolution = platform::TimerResolution(); + + // Estimates the expected value of "lambda" values with a variable number of + // samples until the variability "rel_mad" is less than "max_rel_mad". + template +-Ticks SampleUntilStable(const double max_rel_mad, double* rel_mad, +- const Params& p, const Lambda& lambda) { ++timer::Ticks SampleUntilStable(const double max_rel_mad, double* rel_mad, ++ const Params& p, const Lambda& lambda) { + // Choose initial samples_per_eval based on a single estimated duration. +- Ticks t0 = timer::Start32(); ++ timer::Ticks t0 = timer::Start(); + lambda(); +- Ticks t1 = timer::Stop32(); +- Ticks est = t1 - t0; ++ timer::Ticks t1 = timer::Stop(); ++ timer::Ticks est = t1 - t0; + static const double ticks_per_second = platform::InvariantTicksPerSecond(); + const size_t ticks_per_eval = + static_cast(ticks_per_second * p.seconds_per_eval); +@@ -481,21 +461,21 @@ Ticks SampleUntilStable(const double max + est == 0 ? p.min_samples_per_eval : ticks_per_eval / est; + samples_per_eval = std::max(samples_per_eval, p.min_samples_per_eval); + +- std::vector samples; ++ std::vector samples; + samples.reserve(1 + samples_per_eval); + samples.push_back(est); + + // Percentage is too strict for tiny differences, so also allow a small + // absolute "median absolute deviation". +- const Ticks max_abs_mad = (timer_resolution + 99) / 100; ++ const timer::Ticks max_abs_mad = (timer_resolution + 99) / 100; + *rel_mad = 0.0; // ensure initialized + + for (size_t eval = 0; eval < p.max_evals; ++eval, samples_per_eval *= 2) { + samples.reserve(samples.size() + samples_per_eval); + for (size_t i = 0; i < samples_per_eval; ++i) { +- t0 = timer::Start32(); ++ t0 = timer::Start(); + lambda(); +- t1 = timer::Stop32(); ++ t1 = timer::Stop(); + samples.push_back(t1 - t0); + } + +@@ -508,14 +488,14 @@ Ticks SampleUntilStable(const double max + NANOBENCHMARK_CHECK(est != 0); + + // Median absolute deviation (mad) is a robust measure of 'variability'. +- const Ticks abs_mad = robust_statistics::MedianAbsoluteDeviation( ++ const timer::Ticks abs_mad = robust_statistics::MedianAbsoluteDeviation( + samples.data(), samples.size(), est); +- *rel_mad = static_cast(int(abs_mad)) / est; ++ *rel_mad = static_cast(abs_mad) / static_cast(est); + + if (*rel_mad <= max_rel_mad || abs_mad <= max_abs_mad) { + if (p.verbose) { +- printf("%6zu samples => %5u (abs_mad=%4u, rel_mad=%4.2f%%)\n", +- samples.size(), est, abs_mad, *rel_mad * 100.0); ++ printf("%6zu samples => %5zu (abs_mad=%4zu, rel_mad=%4.2f%%)\n", ++ samples.size(), size_t(est), size_t(abs_mad), *rel_mad * 100.0); + } + return est; + } +@@ -539,29 +519,17 @@ InputVec UniqueInputs(const FuncInput* i + return unique; + } + +-// Returns how often we need to call func for sufficient precision, or zero +-// on failure (e.g. the elapsed time is too long for a 32-bit tick count). ++// Returns how often we need to call func for sufficient precision. + size_t NumSkip(const Func func, const uint8_t* arg, const InputVec& unique, + const Params& p) { + // Min elapsed ticks for any input. +- Ticks min_duration = ~0u; ++ timer::Ticks min_duration = ~timer::Ticks(0); + + for (const FuncInput input : unique) { +- // Make sure a 32-bit timer is sufficient. +- const uint64_t t0 = timer::Start64(); +- PreventElision(func(arg, input)); +- const uint64_t t1 = timer::Stop64(); +- const uint64_t elapsed = t1 - t0; +- if (elapsed >= (1ULL << 30)) { +- fprintf(stderr, "Measurement failed: need 64-bit timer for input=%zu\n", +- input); +- return 0; +- } +- + double rel_mad; +- const Ticks total = SampleUntilStable( ++ const timer::Ticks total = SampleUntilStable( + p.target_rel_mad, &rel_mad, p, +- [func, arg, input]() { PreventElision(func(arg, input)); }); ++ [func, arg, input]() { platform::PreventElision(func(arg, input)); }); + min_duration = std::min(min_duration, total - timer_resolution); + } + +@@ -571,8 +539,8 @@ size_t NumSkip(const Func func, const ui + const size_t num_skip = + min_duration == 0 ? 0 : (max_skip + min_duration - 1) / min_duration; + if (p.verbose) { +- printf("res=%u max_skip=%zu min_dur=%u num_skip=%zu\n", timer_resolution, +- max_skip, min_duration, num_skip); ++ printf("res=%zu max_skip=%zu min_dur=%zu num_skip=%zu\n", ++ size_t(timer_resolution), max_skip, size_t(min_duration), num_skip); + } + return num_skip; + } +@@ -637,13 +605,14 @@ void FillSubset(const InputVec& full, co + } + + // Returns total ticks elapsed for all inputs. +-Ticks TotalDuration(const Func func, const uint8_t* arg, const InputVec* inputs, +- const Params& p, double* max_rel_mad) { ++timer::Ticks TotalDuration(const Func func, const uint8_t* arg, ++ const InputVec* inputs, const Params& p, ++ double* max_rel_mad) { + double rel_mad; +- const Ticks duration = ++ const timer::Ticks duration = + SampleUntilStable(p.target_rel_mad, &rel_mad, p, [func, arg, inputs]() { + for (const FuncInput input : *inputs) { +- PreventElision(func(arg, input)); ++ platform::PreventElision(func(arg, input)); + } + }); + *max_rel_mad = std::max(*max_rel_mad, rel_mad); +@@ -657,19 +626,20 @@ HWY_NOINLINE FuncOutput EmptyFunc(const + + // Returns overhead of accessing inputs[] and calling a function; this will + // be deducted from future TotalDuration return values. +-Ticks Overhead(const uint8_t* arg, const InputVec* inputs, const Params& p) { ++timer::Ticks Overhead(const uint8_t* arg, const InputVec* inputs, ++ const Params& p) { + double rel_mad; + // Zero tolerance because repeatability is crucial and EmptyFunc is fast. + return SampleUntilStable(0.0, &rel_mad, p, [arg, inputs]() { + for (const FuncInput input : *inputs) { +- PreventElision(EmptyFunc(arg, input)); ++ platform::PreventElision(EmptyFunc(arg, input)); + } + }); + } + + } // namespace + +-int Unpredictable1() { return timer::Start64() != ~0ULL; } ++int Unpredictable1() { return timer::Start() != ~0ULL; } + + size_t Measure(const Func func, const uint8_t* arg, const FuncInput* inputs, + const size_t num_inputs, Result* results, const Params& p) { +@@ -685,32 +655,35 @@ size_t Measure(const Func func, const ui + ReplicateInputs(inputs, num_inputs, unique.size(), num_skip, p); + InputVec subset(full.size() - num_skip); + +- const Ticks overhead = Overhead(arg, &full, p); +- const Ticks overhead_skip = Overhead(arg, &subset, p); ++ const timer::Ticks overhead = Overhead(arg, &full, p); ++ const timer::Ticks overhead_skip = Overhead(arg, &subset, p); + if (overhead < overhead_skip) { +- fprintf(stderr, "Measurement failed: overhead %u < %u\n", overhead, +- overhead_skip); ++ fprintf(stderr, "Measurement failed: overhead %zu < %zu\n", ++ size_t(overhead), size_t(overhead_skip)); + return 0; + } + + if (p.verbose) { +- printf("#inputs=%5zu,%5zu overhead=%5u,%5u\n", full.size(), subset.size(), +- overhead, overhead_skip); ++ printf("#inputs=%5zu,%5zu overhead=%5zu,%5zu\n", full.size(), subset.size(), ++ size_t(overhead), size_t(overhead_skip)); + } + + double max_rel_mad = 0.0; +- const Ticks total = TotalDuration(func, arg, &full, p, &max_rel_mad); ++ const timer::Ticks total = TotalDuration(func, arg, &full, p, &max_rel_mad); + + for (size_t i = 0; i < unique.size(); ++i) { + FillSubset(full, unique[i], num_skip, &subset); +- const Ticks total_skip = TotalDuration(func, arg, &subset, p, &max_rel_mad); ++ const timer::Ticks total_skip = ++ TotalDuration(func, arg, &subset, p, &max_rel_mad); + + if (total < total_skip) { +- fprintf(stderr, "Measurement failed: total %u < %u\n", total, total_skip); ++ fprintf(stderr, "Measurement failed: total %zu < %zu\n", size_t(total), ++ size_t(total_skip)); + return 0; + } + +- const Ticks duration = (total - overhead) - (total_skip - overhead_skip); ++ const timer::Ticks duration = ++ (total - overhead) - (total_skip - overhead_skip); + results[i].input = unique[i]; + results[i].ticks = static_cast(duration) * mul; + results[i].variability = static_cast(max_rel_mad); +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/nanobenchmark.ccE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/nanobenchmark.ccE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/nanobenchmark.h.12 chromium-91.0.4472.77/third_party/highway/src/hwy/nanobenchmark.h +--- chromium-91.0.4472.77/third_party/highway/src/hwy/nanobenchmark.h.12 2021-06-02 10:56:05.272904579 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/nanobenchmark.h 2021-05-31 10:37:11.000000000 -0400 +@@ -44,11 +44,6 @@ + // central tendency of the measurement samples with the "half sample mode", + // which is more robust to outliers and skewed data than the mean or median. + +-// WARNING if included from multiple translation units compiled with distinct +-// flags: this header requires textual inclusion and a predefined NB_NAMESPACE +-// macro that is unique to the current compile flags. We must also avoid +-// standard library headers such as vector and functional that define functions. +- + #include + #include + +@@ -79,6 +74,16 @@ namespace platform { + // This call may be expensive, callers should cache the result. + double InvariantTicksPerSecond(); + ++// Returns current timestamp [in seconds] relative to an unspecified origin. ++// Features: monotonic (no negative elapsed time), steady (unaffected by system ++// time changes), high-resolution (on the order of microseconds). ++double Now(); ++ ++// Returns ticks elapsed in back to back timer calls, i.e. a function of the ++// timer resolution (minimum measurable difference) and overhead. ++// This call is expensive, callers should cache the result. ++uint64_t TimerResolution(); ++ + } // namespace platform + + // Returns 1, but without the compiler knowing what the value is. This prevents +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/nanobenchmark.hE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/nanobenchmark.hE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/nanobenchmark_test.cc.12 chromium-91.0.4472.77/third_party/highway/src/hwy/nanobenchmark_test.cc +--- chromium-91.0.4472.77/third_party/highway/src/hwy/nanobenchmark_test.cc.12 2021-06-02 10:56:05.275904594 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/nanobenchmark_test.cc 2021-05-31 10:37:11.000000000 -0400 +@@ -15,11 +15,11 @@ + #include "hwy/nanobenchmark.h" + + #include +-#include // strtol +-#include // sleep + + #include + ++#include "hwy/tests/test_util-inl.h" ++ + namespace hwy { + namespace { + +@@ -31,6 +31,7 @@ FuncOutput Div(const void*, FuncInput in + + template + void MeasureDiv(const FuncInput (&inputs)[N]) { ++ printf("Measuring integer division (output on final two lines)\n"); + Result results[N]; + Params params; + params.max_evals = 4; // avoid test timeout +@@ -66,39 +67,14 @@ void MeasureRandom(const FuncInput (&inp + } + } + +-template +-void EnsureLongMeasurementFails(const FuncInput (&inputs)[N]) { +- printf("Expect a 'measurement failed' below:\n"); +- Result results[N]; +- +- const size_t num_results = Measure( +- [](const void*, const FuncInput input) -> FuncOutput { +- // Loop until the sleep succeeds (not interrupted by signal). We assume +- // >= 512 MHz, so 2 seconds will exceed the 1 << 30 tick safety limit. +- while (sleep(2) != 0) { +- } +- return input; +- }, +- nullptr, inputs, N, results); +- NANOBENCHMARK_CHECK(num_results == 0); +- (void)num_results; +-} +- +-void RunAll(const int argc, char** /*argv*/) { +- // unpredictable == 1 but the compiler doesn't know that. +- const int unpredictable = argc != 999; ++TEST(NanobenchmarkTest, RunAll) { ++ const int unpredictable = Unpredictable1(); // == 1, unknown to compiler. + static const FuncInput inputs[] = {static_cast(unpredictable) + 2, + static_cast(unpredictable + 9)}; + + MeasureDiv(inputs); + MeasureRandom(inputs); +- EnsureLongMeasurementFails(inputs); + } + + } // namespace + } // namespace hwy +- +-int main(int argc, char* argv[]) { +- hwy::RunAll(argc, argv); +- return 0; +-} +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/nanobenchmark_test.ccE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/nanobenchmark_test.ccE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/ops/arm_neon-inl.h.12 chromium-91.0.4472.77/third_party/highway/src/hwy/ops/arm_neon-inl.h +--- chromium-91.0.4472.77/third_party/highway/src/hwy/ops/arm_neon-inl.h.12 2021-06-02 10:56:05.239904412 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/ops/arm_neon-inl.h 2021-05-31 10:37:11.000000000 -0400 +@@ -26,6 +26,8 @@ HWY_BEFORE_NAMESPACE(); + namespace hwy { + namespace HWY_NAMESPACE { + ++namespace detail { // for code folding and Raw128 ++ + // Macros used to define single and double function calls for multiple types + // for full and half vectors. These macros are undefined at the end of the file. + +@@ -133,7 +135,7 @@ namespace HWY_NAMESPACE { + HWY_NEON_DEF_FUNCTION(int64_t, 1, name, prefix, infix, s64, args) + + // float and double +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + #define HWY_NEON_DEF_FUNCTION_ALL_FLOATS(name, prefix, infix, args) \ + HWY_NEON_DEF_FUNCTION(float, 4, name, prefix##q, infix, f32, args) \ + HWY_NEON_DEF_FUNCTION(float, 2, name, prefix, infix, f32, args) \ +@@ -181,7 +183,7 @@ namespace HWY_NAMESPACE { + HWY_NEON_DEF_FUNCTION_ALL_FLOATS(name, prefix, infix, args) + + // Emulation of some intrinsics on armv7. +-#if !defined(__aarch64__) ++#if HWY_ARCH_ARM_V7 + #define vuzp1_s8(x, y) vuzp_s8(x, y).val[0] + #define vuzp1_u8(x, y) vuzp_u8(x, y).val[0] + #define vuzp1_s16(x, y) vuzp_s16(x, y).val[0] +@@ -294,7 +296,7 @@ struct Raw128 { + using type = float32x4_t; + }; + +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + template <> + struct Raw128 { + using type = float64x2_t; +@@ -352,7 +354,7 @@ struct Raw128 { + using type = float32x2_t; + }; + +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + template <> + struct Raw128 { + using type = float64x1_t; +@@ -437,12 +439,14 @@ struct Raw128 { + using type = int8x8_t; + }; + ++} // namespace detail ++ + template + using Full128 = Simd; + + template + class Vec128 { +- using Raw = typename Raw128::type; ++ using Raw = typename detail::Raw128::type; + + public: + HWY_INLINE Vec128() {} +@@ -480,7 +484,8 @@ class Vec128 { + // FF..FF or 0, also for floating-point - see README. + template + class Mask128 { +- using Raw = typename Raw128::type; ++ // ARM C Language Extensions return and expect unsigned type. ++ using Raw = typename detail::Raw128, N>::type; + + public: + HWY_INLINE Mask128() {} +@@ -573,7 +578,7 @@ HWY_INLINE Vec128 BitCastFro + Vec128 v) { + return Vec128(vreinterpret_s64_u8(v.raw)); + } +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + HWY_INLINE Vec128 BitCastFromByte(Simd /* tag */, + Vec128 v) { + return Vec128(vreinterpret_f64_u8(v.raw)); +@@ -615,7 +620,7 @@ HWY_INLINE Vec128 BitCastFromBy + return Vec128(vreinterpretq_s64_u8(v.raw)); + } + +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + HWY_INLINE Vec128 BitCastFromByte(Full128 /* tag */, + Vec128 v) { + return Vec128(vreinterpretq_f64_u8(v.raw)); +@@ -664,15 +669,25 @@ template + HWY_INLINE Vec128 Undefined(Simd /*d*/) { + HWY_DIAGNOSTICS(push) + HWY_DIAGNOSTICS_OFF(disable : 4701, ignored "-Wuninitialized") +- typename Raw128::type a; ++ typename detail::Raw128::type a; + return Vec128(a); + HWY_DIAGNOSTICS(pop) + } + +-// ------------------------------ Extract lane ++// Returns a vector with lane i=[0, N) set to "first" + i. ++template ++Vec128 Iota(const Simd d, const T2 first) { ++ HWY_ALIGN T lanes[16 / sizeof(T)]; ++ for (size_t i = 0; i < 16 / sizeof(T); ++i) { ++ lanes[i] = static_cast(first + static_cast(i)); ++ } ++ return Load(d, lanes); ++} ++ ++// ------------------------------ GetLane + + HWY_INLINE uint8_t GetLane(const Vec128 v) { +- return vget_lane_u8(vget_low_u8(v.raw), 0); ++ return vgetq_lane_u8(v.raw, 0); + } + template + HWY_INLINE uint8_t GetLane(const Vec128 v) { +@@ -680,7 +695,7 @@ HWY_INLINE uint8_t GetLane(const Vec128< + } + + HWY_INLINE int8_t GetLane(const Vec128 v) { +- return vget_lane_s8(vget_low_s8(v.raw), 0); ++ return vgetq_lane_s8(v.raw, 0); + } + template + HWY_INLINE int8_t GetLane(const Vec128 v) { +@@ -688,7 +703,7 @@ HWY_INLINE int8_t GetLane(const Vec128 v) { +- return vget_lane_u16(vget_low_u16(v.raw), 0); ++ return vgetq_lane_u16(v.raw, 0); + } + template + HWY_INLINE uint16_t GetLane(const Vec128 v) { +@@ -696,7 +711,7 @@ HWY_INLINE uint16_t GetLane(const Vec128 + } + + HWY_INLINE int16_t GetLane(const Vec128 v) { +- return vget_lane_s16(vget_low_s16(v.raw), 0); ++ return vgetq_lane_s16(v.raw, 0); + } + template + HWY_INLINE int16_t GetLane(const Vec128 v) { +@@ -704,7 +719,7 @@ HWY_INLINE int16_t GetLane(const Vec128< + } + + HWY_INLINE uint32_t GetLane(const Vec128 v) { +- return vget_lane_u32(vget_low_u32(v.raw), 0); ++ return vgetq_lane_u32(v.raw, 0); + } + template + HWY_INLINE uint32_t GetLane(const Vec128 v) { +@@ -712,7 +727,7 @@ HWY_INLINE uint32_t GetLane(const Vec128 + } + + HWY_INLINE int32_t GetLane(const Vec128 v) { +- return vget_lane_s32(vget_low_s32(v.raw), 0); ++ return vgetq_lane_s32(v.raw, 0); + } + template + HWY_INLINE int32_t GetLane(const Vec128 v) { +@@ -720,20 +735,20 @@ HWY_INLINE int32_t GetLane(const Vec128< + } + + HWY_INLINE uint64_t GetLane(const Vec128 v) { +- return vget_lane_u64(vget_low_u64(v.raw), 0); ++ return vgetq_lane_u64(v.raw, 0); + } + HWY_INLINE uint64_t GetLane(const Vec128 v) { + return vget_lane_u64(v.raw, 0); + } + HWY_INLINE int64_t GetLane(const Vec128 v) { +- return vget_lane_s64(vget_low_s64(v.raw), 0); ++ return vgetq_lane_s64(v.raw, 0); + } + HWY_INLINE int64_t GetLane(const Vec128 v) { + return vget_lane_s64(v.raw, 0); + } + + HWY_INLINE float GetLane(const Vec128 v) { +- return vget_lane_f32(vget_low_f32(v.raw), 0); ++ return vgetq_lane_f32(v.raw, 0); + } + HWY_INLINE float GetLane(const Vec128 v) { + return vget_lane_f32(v.raw, 0); +@@ -741,9 +756,9 @@ HWY_INLINE float GetLane(const Vec128 v) { + return vget_lane_f32(v.raw, 0); + } +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + HWY_INLINE double GetLane(const Vec128 v) { +- return vget_lane_f64(vget_low_f64(v.raw), 0); ++ return vgetq_lane_f64(v.raw, 0); + } + HWY_INLINE double GetLane(const Vec128 v) { + return vget_lane_f64(v.raw, 0); +@@ -785,8 +800,6 @@ HWY_NEON_DEF_FUNCTION_INT_64(SaturatedSu + // ------------------------------ Average + + // Returns (a + b + 1) / 2 +- +-// Unsigned + HWY_NEON_DEF_FUNCTION_UINT_8(AverageRound, vrhadd, _, 2) + HWY_NEON_DEF_FUNCTION_UINT_16(AverageRound, vrhadd, _, 2) + +@@ -802,6 +815,7 @@ HWY_INLINE Vec128 Abs(const Vec + HWY_INLINE Vec128 Abs(const Vec128 v) { + return Vec128(vabsq_s32(v.raw)); + } ++// i64 is implemented after BroadcastSignBit. + HWY_INLINE Vec128 Abs(const Vec128 v) { + return Vec128(vabsq_f32(v.raw)); + } +@@ -823,7 +837,7 @@ HWY_INLINE Vec128 Abs(const Ve + return Vec128(vabs_f32(v.raw)); + } + +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + HWY_INLINE Vec128 Abs(const Vec128 v) { + return Vec128(vabsq_f64(v.raw)); + } +@@ -839,7 +853,7 @@ HWY_NEON_DEF_FUNCTION_ALL_FLOATS(Neg, vn + HWY_NEON_DEF_FUNCTION_INT_8_16_32(Neg, vneg, _, 1) // i64 implemented below + + HWY_INLINE Vec128 Neg(const Vec128 v) { +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + return Vec128(vneg_s64(v.raw)); + #else + return Zero(Simd()) - v; +@@ -847,7 +861,7 @@ HWY_INLINE Vec128 Neg(const + } + + HWY_INLINE Vec128 Neg(const Vec128 v) { +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + return Vec128(vnegq_s64(v.raw)); + #else + return Zero(Full128()) - v; +@@ -876,6 +890,16 @@ HWY_NEON_DEF_FUNCTION_INTS(ShiftRight, v + + // ------------------------------ Shl + ++HWY_INLINE Vec128 operator<<(const Vec128 v, ++ const Vec128 bits) { ++ return Vec128(vshlq_u8(v.raw, vreinterpretq_s8_u8(bits.raw))); ++} ++template ++HWY_INLINE Vec128 operator<<(const Vec128 v, ++ const Vec128 bits) { ++ return Vec128(vshl_u8(v.raw, vreinterpret_s8_u8(bits.raw))); ++} ++ + HWY_INLINE Vec128 operator<<(const Vec128 v, + const Vec128 bits) { + return Vec128(vshlq_u16(v.raw, vreinterpretq_s16_u16(bits.raw))); +@@ -905,6 +929,16 @@ HWY_INLINE Vec128 operator< + return Vec128(vshl_u64(v.raw, vreinterpret_s64_u64(bits.raw))); + } + ++HWY_INLINE Vec128 operator<<(const Vec128 v, ++ const Vec128 bits) { ++ return Vec128(vshlq_s8(v.raw, bits.raw)); ++} ++template ++HWY_INLINE Vec128 operator<<(const Vec128 v, ++ const Vec128 bits) { ++ return Vec128(vshl_s8(v.raw, bits.raw)); ++} ++ + HWY_INLINE Vec128 operator<<(const Vec128 v, + const Vec128 bits) { + return Vec128(vshlq_s16(v.raw, bits.raw)); +@@ -936,6 +970,18 @@ HWY_INLINE Vec128 operator<< + + // ------------------------------ Shr (Neg) + ++HWY_INLINE Vec128 operator>>(const Vec128 v, ++ const Vec128 bits) { ++ const int8x16_t neg_bits = Neg(BitCast(Full128(), bits)).raw; ++ return Vec128(vshlq_u8(v.raw, neg_bits)); ++} ++template ++HWY_INLINE Vec128 operator>>(const Vec128 v, ++ const Vec128 bits) { ++ const int8x8_t neg_bits = Neg(BitCast(Simd(), bits)).raw; ++ return Vec128(vshl_u8(v.raw, neg_bits)); ++} ++ + HWY_INLINE Vec128 operator>>(const Vec128 v, + const Vec128 bits) { + const int16x8_t neg_bits = Neg(BitCast(Full128(), bits)).raw; +@@ -971,6 +1017,16 @@ HWY_INLINE Vec128 operator> + return Vec128(vshl_u64(v.raw, neg_bits)); + } + ++HWY_INLINE Vec128 operator>>(const Vec128 v, ++ const Vec128 bits) { ++ return Vec128(vshlq_s8(v.raw, Neg(bits).raw)); ++} ++template ++HWY_INLINE Vec128 operator>>(const Vec128 v, ++ const Vec128 bits) { ++ return Vec128(vshl_s8(v.raw, Neg(bits).raw)); ++} ++ + HWY_INLINE Vec128 operator>>(const Vec128 v, + const Vec128 bits) { + return Vec128(vshlq_s16(v.raw, Neg(bits).raw)); +@@ -1059,7 +1115,7 @@ HWY_INLINE Vec128 operator*( + HWY_INLINE Vec128 MulHigh(const Vec128 a, + const Vec128 b) { + int32x4_t rlo = vmull_s16(vget_low_s16(a.raw), vget_low_s16(b.raw)); +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + int32x4_t rhi = vmull_high_s16(a.raw, b.raw); + #else + int32x4_t rhi = vmull_s16(vget_high_s16(a.raw), vget_high_s16(b.raw)); +@@ -1070,7 +1126,7 @@ HWY_INLINE Vec128 MulHigh(const + HWY_INLINE Vec128 MulHigh(const Vec128 a, + const Vec128 b) { + uint32x4_t rlo = vmull_u16(vget_low_u16(a.raw), vget_low_u16(b.raw)); +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + uint32x4_t rhi = vmull_high_u16(a.raw, b.raw); + #else + uint32x4_t rhi = vmull_u16(vget_high_u16(a.raw), vget_high_u16(b.raw)); +@@ -1139,24 +1195,37 @@ HWY_INLINE Vec128 ApproximateR + return Vec128(vrecpe_f32(v.raw)); + } + +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + HWY_NEON_DEF_FUNCTION_ALL_FLOATS(operator/, vdiv, _, 2) + #else +-// Emulated with approx reciprocal + Newton-Raphson + mul ++// Not defined on armv7: approximate ++namespace detail { ++ ++HWY_INLINE Vec128 ReciprocalNewtonRaphsonStep( ++ const Vec128 recip, const Vec128 divisor) { ++ return Vec128(vrecpsq_f32(recip.raw, divisor.raw)); ++} ++template ++HWY_INLINE Vec128 ReciprocalNewtonRaphsonStep( ++ const Vec128 recip, Vec128 divisor) { ++ return Vec128(vrecps_f32(recip.raw, divisor.raw)); ++} ++ ++} // namespace detail ++ + template + HWY_INLINE Vec128 operator/(const Vec128 a, + const Vec128 b) { + auto x = ApproximateReciprocal(b); +- // Newton-Raphson on 1/x - b +- const auto two = Set(Simd(), 2); +- x = x * (two - b * x); +- x = x * (two - b * x); +- x = x * (two - b * x); ++ x *= detail::ReciprocalNewtonRaphsonStep(x, b); ++ x *= detail::ReciprocalNewtonRaphsonStep(x, b); ++ x *= detail::ReciprocalNewtonRaphsonStep(x, b); + return a * x; + } + #endif + +-// Absolute value of difference. ++// ------------------------------ Absolute value of difference. ++ + HWY_INLINE Vec128 AbsDiff(const Vec128 a, const Vec128 b) { + return Vec128(vabdq_f32(a.raw, b.raw)); + } +@@ -1169,7 +1238,7 @@ HWY_INLINE Vec128 AbsDiff(cons + // ------------------------------ Floating-point multiply-add variants + + // Returns add + mul * x +-#if defined(__aarch64__) ++#if defined(__ARM_VFPV4__) || HWY_ARCH_ARM_A64 + template + HWY_INLINE Vec128 MulAdd(const Vec128 mul, + const Vec128 x, +@@ -1180,6 +1249,17 @@ HWY_INLINE Vec128 MulAdd(const Ve + const Vec128 add) { + return Vec128(vfmaq_f32(add.raw, mul.raw, x.raw)); + } ++#else ++// Emulate FMA for floats. ++template ++HWY_INLINE Vec128 MulAdd(const Vec128 mul, ++ const Vec128 x, ++ const Vec128 add) { ++ return mul * x + add; ++} ++#endif ++ ++#if HWY_ARCH_ARM_A64 + HWY_INLINE Vec128 MulAdd(const Vec128 mul, + const Vec128 x, + const Vec128 add) { +@@ -1190,18 +1270,10 @@ HWY_INLINE Vec128 MulAdd(const V + const Vec128 add) { + return Vec128(vfmaq_f64(add.raw, mul.raw, x.raw)); + } +-#else +-// Emulate FMA for floats. +-template +-HWY_INLINE Vec128 MulAdd(const Vec128 mul, +- const Vec128 x, +- const Vec128 add) { +- return mul * x + add; +-} + #endif + + // Returns add - mul * x +-#if defined(__aarch64__) ++#if defined(__ARM_VFPV4__) || HWY_ARCH_ARM_A64 + template + HWY_INLINE Vec128 NegMulAdd(const Vec128 mul, + const Vec128 x, +@@ -1213,7 +1285,17 @@ HWY_INLINE Vec128 NegMulAdd(const + const Vec128 add) { + return Vec128(vfmsq_f32(add.raw, mul.raw, x.raw)); + } ++#else ++// Emulate FMA for floats. ++template ++HWY_INLINE Vec128 NegMulAdd(const Vec128 mul, ++ const Vec128 x, ++ const Vec128 add) { ++ return add - mul * x; ++} ++#endif + ++#if HWY_ARCH_ARM_A64 + HWY_INLINE Vec128 NegMulAdd(const Vec128 mul, + const Vec128 x, + const Vec128 add) { +@@ -1224,14 +1306,6 @@ HWY_INLINE Vec128 NegMulAdd(cons + const Vec128 add) { + return Vec128(vfmsq_f64(add.raw, mul.raw, x.raw)); + } +-#else +-// Emulate FMA for floats. +-template +-HWY_INLINE Vec128 NegMulAdd(const Vec128 mul, +- const Vec128 x, +- const Vec128 add) { +- return add - mul * x; +-} + #endif + + // Returns mul * x - sub +@@ -1241,12 +1315,6 @@ HWY_INLINE Vec128 MulSub(const + const Vec128 sub) { + return MulAdd(mul, x, Neg(sub)); + } +-template +-HWY_INLINE Vec128 MulSub(const Vec128 mul, +- const Vec128 x, +- const Vec128 sub) { +- return MulAdd(mul, x, Neg(sub)); +-} + + // Returns -mul * x - sub + template +@@ -1255,14 +1323,23 @@ HWY_INLINE Vec128 NegMulSub(co + const Vec128 sub) { + return Neg(MulAdd(mul, x, sub)); + } ++ ++#if HWY_ARCH_ARM_A64 ++template ++HWY_INLINE Vec128 MulSub(const Vec128 mul, ++ const Vec128 x, ++ const Vec128 sub) { ++ return MulAdd(mul, x, Neg(sub)); ++} + template + HWY_INLINE Vec128 NegMulSub(const Vec128 mul, + const Vec128 x, + const Vec128 sub) { + return Neg(MulAdd(mul, x, sub)); + } ++#endif + +-// ------------------------------ Floating-point square root ++// ------------------------------ Floating-point square root (IfThenZeroElse) + + // Approximate reciprocal square root + HWY_INLINE Vec128 ApproximateReciprocalSqrt(const Vec128 v) { +@@ -1275,80 +1352,36 @@ HWY_INLINE Vec128 ApproximateR + } + + // Full precision square root +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + HWY_NEON_DEF_FUNCTION_ALL_FLOATS(Sqrt, vsqrt, _, 1) + #else +-// Not defined on armv7: emulate with approx reciprocal sqrt + Goldschmidt. +-template +-HWY_INLINE Vec128 Sqrt(const Vec128 v) { +- auto b = v; +- auto Y = ApproximateReciprocalSqrt(v); +- auto x = v * Y; +- const auto half = Set(Simd(), 0.5); +- const auto oneandhalf = Set(Simd(), 1.5); +- for (size_t i = 0; i < 3; i++) { +- b = b * Y * Y; +- Y = oneandhalf - half * b; +- x = x * Y; +- } +- return IfThenZeroElse(v == Zero(Simd()), x); +-} +-#endif +- +-// ================================================== COMPARE +- +-// Comparisons fill a lane with 1-bits if the condition is true, else 0. ++namespace detail { + +-template +-HWY_API Mask128 RebindMask(Simd /*tag*/, Mask128 m) { +- static_assert(sizeof(TFrom) == sizeof(TTo), "Must have same size"); +- return Mask128{m.raw}; ++HWY_INLINE Vec128 ReciprocalSqrtStep(const Vec128 root, ++ const Vec128 recip) { ++ return Vec128(vrsqrtsq_f32(root.raw, recip.raw)); ++} ++template ++HWY_INLINE Vec128 ReciprocalSqrtStep(const Vec128 root, ++ Vec128 recip) { ++ return Vec128(vrsqrts_f32(root.raw, recip.raw)); + } + +-#define HWY_NEON_BUILD_TPL_HWY_COMPARE +-#define HWY_NEON_BUILD_RET_HWY_COMPARE(type, size) Mask128 +-#define HWY_NEON_BUILD_PARAM_HWY_COMPARE(type, size) \ +- const Vec128 a, const Vec128 b +-#define HWY_NEON_BUILD_ARG_HWY_COMPARE a.raw, b.raw +- +-// ------------------------------ Equality +-HWY_NEON_DEF_FUNCTION_ALL_FLOATS(operator==, vceq, _, HWY_COMPARE) +-#if defined(__aarch64__) +-HWY_NEON_DEF_FUNCTION_INTS_UINTS(operator==, vceq, _, HWY_COMPARE) +-#else +-// No 64-bit comparisons on armv7: emulate them below, after Shuffle2301. +-HWY_NEON_DEF_FUNCTION_INT_8_16_32(operator==, vceq, _, HWY_COMPARE) +-HWY_NEON_DEF_FUNCTION_UINT_8_16_32(operator==, vceq, _, HWY_COMPARE) +-#endif ++} // namespace detail + +-// ------------------------------ Strict inequality ++// Not defined on armv7: approximate ++template ++HWY_INLINE Vec128 Sqrt(const Vec128 v) { ++ auto recip = ApproximateReciprocalSqrt(v); + +-// Signed/float < (no unsigned) +-#if defined(__aarch64__) +-HWY_NEON_DEF_FUNCTION_INTS(operator<, vclt, _, HWY_COMPARE) +-#else +-HWY_NEON_DEF_FUNCTION_INT_8_16_32(operator<, vclt, _, HWY_COMPARE) +-#endif +-HWY_NEON_DEF_FUNCTION_ALL_FLOATS(operator<, vclt, _, HWY_COMPARE) ++ recip *= detail::ReciprocalSqrtStep(v * recip, recip); ++ recip *= detail::ReciprocalSqrtStep(v * recip, recip); ++ recip *= detail::ReciprocalSqrtStep(v * recip, recip); + +-// Signed/float > (no unsigned) +-#if defined(__aarch64__) +-HWY_NEON_DEF_FUNCTION_INTS(operator>, vcgt, _, HWY_COMPARE) +-#else +-HWY_NEON_DEF_FUNCTION_INT_8_16_32(operator>, vcgt, _, HWY_COMPARE) ++ const auto root = v * recip; ++ return IfThenZeroElse(v == Zero(Simd()), root); ++} + #endif +-HWY_NEON_DEF_FUNCTION_ALL_FLOATS(operator>, vcgt, _, HWY_COMPARE) +- +-// ------------------------------ Weak inequality +- +-// Float <= >= +-HWY_NEON_DEF_FUNCTION_ALL_FLOATS(operator<=, vcle, _, HWY_COMPARE) +-HWY_NEON_DEF_FUNCTION_ALL_FLOATS(operator>=, vcge, _, HWY_COMPARE) +- +-#undef HWY_NEON_BUILD_TPL_HWY_COMPARE +-#undef HWY_NEON_BUILD_RET_HWY_COMPARE +-#undef HWY_NEON_BUILD_PARAM_HWY_COMPARE +-#undef HWY_NEON_BUILD_ARG_HWY_COMPARE + + // ================================================== LOGICAL + +@@ -1357,13 +1390,16 @@ HWY_NEON_DEF_FUNCTION_ALL_FLOATS(operato + // There is no 64-bit vmvn, so cast instead of using HWY_NEON_DEF_FUNCTION. + template + HWY_INLINE Vec128 Not(const Vec128 v) { +- const Full128 d8; +- return Vec128(vmvnq_u8(BitCast(d8, v).raw)); ++ const Full128 d; ++ const Repartition d8; ++ return BitCast(d, Vec128(vmvnq_u8(BitCast(d8, v).raw))); + } + template + HWY_INLINE Vec128 Not(const Vec128 v) { +- const Repartition> d8; +- return Vec128(vmvn_u8(BitCast(d8, v).raw)); ++ const Simd d; ++ const Repartition d8; ++ using V8 = decltype(Zero(d8)); ++ return BitCast(d, V8(vmvn_u8(BitCast(d8, v).raw))); + } + + // ------------------------------ And +@@ -1463,33 +1499,38 @@ HWY_API Vec128 BroadcastSignBit(co + return ShiftRight(v); + } + +-// ------------------------------ Make mask ++// ================================================== MASK + +-template +-HWY_INLINE Mask128 TestBit(Vec128 v, Vec128 bit) { +- static_assert(!hwy::IsFloat(), "Only integer vectors supported"); +- return (v & bit) == bit; +-} ++// ------------------------------ To/from vector + +-// Mask and Vec are the same (true = FF..FF). ++// Mask and Vec have the same representation (true = FF..FF). + template + HWY_INLINE Mask128 MaskFromVec(const Vec128 v) { +- return Mask128(v.raw); ++ const Simd, N> du; ++ return Mask128(BitCast(du, v).raw); + } + ++// DEPRECATED + template + HWY_INLINE Vec128 VecFromMask(const Mask128 v) { +- return Vec128(v.raw); ++ return BitCast(Simd(), Vec128, N>(v.raw)); + } + + template +-HWY_INLINE Vec128 VecFromMask(Simd /* tag */, +- const Mask128 v) { +- return Vec128(v.raw); ++HWY_INLINE Vec128 VecFromMask(Simd d, const Mask128 v) { ++ return BitCast(d, Vec128, N>(v.raw)); + } + +-// IfThenElse(mask, yes, no) +-// Returns mask ? b : a. ++// ------------------------------ RebindMask ++ ++template ++HWY_API Mask128 RebindMask(Simd dto, Mask128 m) { ++ static_assert(sizeof(TFrom) == sizeof(TTo), "Must have same size"); ++ return MaskFromVec(BitCast(dto, VecFromMask(Simd(), m))); ++} ++ ++// ------------------------------ IfThenElse(mask, yes, no) = mask ? b : a. ++ + #define HWY_NEON_BUILD_TPL_HWY_IF + #define HWY_NEON_BUILD_RET_HWY_IF(type, size) Vec128 + #define HWY_NEON_BUILD_PARAM_HWY_IF(type, size) \ +@@ -1524,7 +1565,6 @@ HWY_INLINE Vec128 ZeroIfNegative(V + return Max(zero, v); + } + +- + // ------------------------------ Mask logical + + template +@@ -1557,30 +1597,183 @@ HWY_API Mask128 Xor(const Mask128< + return MaskFromVec(Xor(VecFromMask(d, a), VecFromMask(d, b))); + } + +-// ------------------------------ Min (IfThenElse, BroadcastSignBit) ++// ================================================== COMPARE + +-namespace detail { ++// Comparisons fill a lane with 1-bits if the condition is true, else 0. + +-#if defined(__aarch64__) ++// ------------------------------ Shuffle2301 (for i64 compares) + +-HWY_INLINE Vec128 Gt(Vec128 a, Vec128 b) { +- return Vec128(vcgtq_u64(a.raw, b.raw)); ++// Swap 32-bit halves in 64-bits ++HWY_INLINE Vec128 Shuffle2301(const Vec128 v) { ++ return Vec128(vrev64_u32(v.raw)); ++} ++HWY_INLINE Vec128 Shuffle2301(const Vec128 v) { ++ return Vec128(vrev64_s32(v.raw)); ++} ++HWY_INLINE Vec128 Shuffle2301(const Vec128 v) { ++ return Vec128(vrev64_f32(v.raw)); ++} ++HWY_INLINE Vec128 Shuffle2301(const Vec128 v) { ++ return Vec128(vrev64q_u32(v.raw)); + } +-HWY_INLINE Vec128 Gt(Vec128 a, +- Vec128 b) { +- return Vec128(vcgt_u64(a.raw, b.raw)); ++HWY_INLINE Vec128 Shuffle2301(const Vec128 v) { ++ return Vec128(vrev64q_s32(v.raw)); ++} ++HWY_INLINE Vec128 Shuffle2301(const Vec128 v) { ++ return Vec128(vrev64q_f32(v.raw)); + } + +-HWY_INLINE Vec128 Gt(Vec128 a, Vec128 b) { +- return Vec128(vcgtq_s64(a.raw, b.raw)); ++#define HWY_NEON_BUILD_TPL_HWY_COMPARE ++#define HWY_NEON_BUILD_RET_HWY_COMPARE(type, size) Mask128 ++#define HWY_NEON_BUILD_PARAM_HWY_COMPARE(type, size) \ ++ const Vec128 a, const Vec128 b ++#define HWY_NEON_BUILD_ARG_HWY_COMPARE a.raw, b.raw ++ ++// ------------------------------ Equality ++HWY_NEON_DEF_FUNCTION_ALL_FLOATS(operator==, vceq, _, HWY_COMPARE) ++#if HWY_ARCH_ARM_A64 ++HWY_NEON_DEF_FUNCTION_INTS_UINTS(operator==, vceq, _, HWY_COMPARE) ++#else ++// No 64-bit comparisons on armv7: emulate them below, after Shuffle2301. ++HWY_NEON_DEF_FUNCTION_INT_8_16_32(operator==, vceq, _, HWY_COMPARE) ++HWY_NEON_DEF_FUNCTION_UINT_8_16_32(operator==, vceq, _, HWY_COMPARE) ++#endif ++ ++// ------------------------------ Strict inequality (signed, float) ++#if HWY_ARCH_ARM_A64 ++HWY_NEON_DEF_FUNCTION_INTS(operator<, vclt, _, HWY_COMPARE) ++#else ++HWY_NEON_DEF_FUNCTION_INT_8_16_32(operator<, vclt, _, HWY_COMPARE) ++#endif ++HWY_NEON_DEF_FUNCTION_ALL_FLOATS(operator<, vclt, _, HWY_COMPARE) ++ ++// ------------------------------ Weak inequality (float) ++HWY_NEON_DEF_FUNCTION_ALL_FLOATS(operator<=, vcle, _, HWY_COMPARE) ++ ++#undef HWY_NEON_BUILD_TPL_HWY_COMPARE ++#undef HWY_NEON_BUILD_RET_HWY_COMPARE ++#undef HWY_NEON_BUILD_PARAM_HWY_COMPARE ++#undef HWY_NEON_BUILD_ARG_HWY_COMPARE ++ ++// ------------------------------ ARMv7 i64 compare (Shuffle2301, Eq) ++ ++#if HWY_ARCH_ARM_V7 ++ ++template ++HWY_INLINE Mask128 operator==(const Vec128 a, ++ const Vec128 b) { ++ const Simd d32; ++ const Simd d64; ++ const auto cmp32 = VecFromMask(d32, Eq(BitCast(d32, a), BitCast(d32, b))); ++ const auto cmp64 = cmp32 & Shuffle2301(cmp32); ++ return MaskFromVec(BitCast(d64, cmp64)); ++} ++ ++template ++HWY_INLINE Mask128 operator==(const Vec128 a, ++ const Vec128 b) { ++ const Simd d32; ++ const Simd d64; ++ const auto cmp32 = VecFromMask(d32, Eq(BitCast(d32, a), BitCast(d32, b))); ++ const auto cmp64 = cmp32 & Shuffle2301(cmp32); ++ return MaskFromVec(BitCast(d64, cmp64)); + } +-HWY_INLINE Vec128 Gt(Vec128 a, Vec128 b) { +- return Vec128(vcgt_s64(a.raw, b.raw)); ++ ++HWY_INLINE Mask128 operator<(const Vec128 a, ++ const Vec128 b) { ++ const int64x2_t sub = vqsubq_s64(a.raw, b.raw); ++ return MaskFromVec(BroadcastSignBit(Vec128(sub))); ++} ++HWY_INLINE Mask128 operator<(const Vec128 a, ++ const Vec128 b) { ++ const int64x1_t sub = vqsub_s64(a.raw, b.raw); ++ return MaskFromVec(BroadcastSignBit(Vec128(sub))); + } + + #endif + +-} // namespace detail ++// ------------------------------ Reversed comparisons ++ ++template ++HWY_API Mask128 operator>(Vec128 a, Vec128 b) { ++ return operator<(b, a); ++} ++template ++HWY_API Mask128 operator>=(Vec128 a, Vec128 b) { ++ return operator<=(b, a); ++} ++ ++// ------------------------------ FirstN (Iota, Lt) ++ ++template ++HWY_API Mask128 FirstN(const Simd d, size_t num) { ++ const RebindToSigned di; // Signed comparisons are cheaper. ++ return RebindMask(d, Iota(di, 0) < Set(di, static_cast>(num))); ++} ++ ++// ------------------------------ TestBit (Eq) ++ ++#define HWY_NEON_BUILD_TPL_HWY_TESTBIT ++#define HWY_NEON_BUILD_RET_HWY_TESTBIT(type, size) Mask128 ++#define HWY_NEON_BUILD_PARAM_HWY_TESTBIT(type, size) \ ++ Vec128 v, Vec128 bit ++#define HWY_NEON_BUILD_ARG_HWY_TESTBIT v.raw, bit.raw ++ ++#if HWY_ARCH_ARM_A64 ++HWY_NEON_DEF_FUNCTION_INTS_UINTS(TestBit, vtst, _, HWY_TESTBIT) ++#else ++// No 64-bit versions on armv7 ++HWY_NEON_DEF_FUNCTION_UINT_8_16_32(TestBit, vtst, _, HWY_TESTBIT) ++HWY_NEON_DEF_FUNCTION_INT_8_16_32(TestBit, vtst, _, HWY_TESTBIT) ++ ++template ++HWY_INLINE Mask128 TestBit(Vec128 v, ++ Vec128 bit) { ++ return (v & bit) == bit; ++} ++template ++HWY_INLINE Mask128 TestBit(Vec128 v, ++ Vec128 bit) { ++ return (v & bit) == bit; ++} ++ ++#endif ++#undef HWY_NEON_BUILD_TPL_HWY_TESTBIT ++#undef HWY_NEON_BUILD_RET_HWY_TESTBIT ++#undef HWY_NEON_BUILD_PARAM_HWY_TESTBIT ++#undef HWY_NEON_BUILD_ARG_HWY_TESTBIT ++ ++// ------------------------------ Abs i64 (IfThenElse, BroadcastSignBit) ++HWY_INLINE Vec128 Abs(const Vec128 v) { ++#if HWY_ARCH_ARM_A64 ++ return Vec128(vabsq_s64(v.raw)); ++#else ++ const auto zero = Zero(Full128()); ++ return IfThenElse(MaskFromVec(BroadcastSignBit(v)), zero - v, v); ++#endif ++} ++HWY_INLINE Vec128 Abs(const Vec128 v) { ++#if HWY_ARCH_ARM_A64 ++ return Vec128(vabs_s64(v.raw)); ++#else ++ const auto zero = Zero(Simd()); ++ return IfThenElse(MaskFromVec(BroadcastSignBit(v)), zero - v, v); ++#endif ++} ++ ++// ------------------------------ Min (IfThenElse, BroadcastSignBit) ++ ++#if HWY_ARCH_ARM_A64 ++ ++HWY_INLINE Mask128 operator<(Vec128 a, Vec128 b) { ++ return Mask128(vcltq_u64(a.raw, b.raw)); ++} ++HWY_INLINE Mask128 operator<(Vec128 a, ++ Vec128 b) { ++ return Mask128(vclt_u64(a.raw, b.raw)); ++} ++ ++#endif + + // Unsigned + HWY_NEON_DEF_FUNCTION_UINT_8_16_32(Min, vmin, _, 2) +@@ -1588,8 +1781,8 @@ HWY_NEON_DEF_FUNCTION_UINT_8_16_32(Min, + template + HWY_INLINE Vec128 Min(const Vec128 a, + const Vec128 b) { +-#if defined(__aarch64__) +- return IfThenElse(MaskFromVec(detail::Gt(a, b)), b, a); ++#if HWY_ARCH_ARM_A64 ++ return IfThenElse(b < a, b, a); + #else + const Simd du; + const Simd di; +@@ -1603,8 +1796,8 @@ HWY_NEON_DEF_FUNCTION_INT_8_16_32(Min, v + template + HWY_INLINE Vec128 Min(const Vec128 a, + const Vec128 b) { +-#if defined(__aarch64__) +- return IfThenElse(MaskFromVec(detail::Gt(a, b)), b, a); ++#if HWY_ARCH_ARM_A64 ++ return IfThenElse(b < a, b, a); + #else + const Vec128 sign = detail::SaturatedSub(a, b); + return IfThenElse(MaskFromVec(BroadcastSignBit(sign)), a, b); +@@ -1612,7 +1805,7 @@ HWY_INLINE Vec128 Min(const + } + + // Float: IEEE minimumNumber on v8, otherwise NaN if any is NaN. +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + HWY_NEON_DEF_FUNCTION_ALL_FLOATS(Min, vminnm, _, 2) + #else + HWY_NEON_DEF_FUNCTION_ALL_FLOATS(Min, vmin, _, 2) +@@ -1626,8 +1819,8 @@ HWY_NEON_DEF_FUNCTION_UINT_8_16_32(Max, + template + HWY_INLINE Vec128 Max(const Vec128 a, + const Vec128 b) { +-#if defined(__aarch64__) +- return IfThenElse(MaskFromVec(detail::Gt(a, b)), a, b); ++#if HWY_ARCH_ARM_A64 ++ return IfThenElse(b < a, a, b); + #else + const Simd du; + const Simd di; +@@ -1641,8 +1834,8 @@ HWY_NEON_DEF_FUNCTION_INT_8_16_32(Max, v + template + HWY_INLINE Vec128 Max(const Vec128 a, + const Vec128 b) { +-#if defined(__aarch64__) +- return IfThenElse(MaskFromVec(detail::Gt(a, b)), a, b); ++#if HWY_ARCH_ARM_A64 ++ return IfThenElse(b < a, a, b); + #else + const Vec128 sign = detail::SaturatedSub(a, b); + return IfThenElse(MaskFromVec(BroadcastSignBit(sign)), b, a); +@@ -1650,7 +1843,7 @@ HWY_INLINE Vec128 Max(const + } + + // Float: IEEE maximumNumber on v8, otherwise NaN if any is NaN. +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + HWY_NEON_DEF_FUNCTION_ALL_FLOATS(Max, vmaxnm, _, 2) + #else + HWY_NEON_DEF_FUNCTION_ALL_FLOATS(Max, vmax, _, 2) +@@ -1696,7 +1889,7 @@ HWY_INLINE Vec128 LoadU(Full128(vld1q_f32(aligned)); + } +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + HWY_INLINE Vec128 LoadU(Full128 /* tag */, + const double* HWY_RESTRICT aligned) { + return Vec128(vld1q_f64(aligned)); +@@ -1741,7 +1934,7 @@ HWY_INLINE Vec128 LoadU(Simd(vld1_f32(p)); + } +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + HWY_INLINE Vec128 LoadU(Simd /* tag */, + const double* HWY_RESTRICT p) { + return Vec128(vld1_f64(p)); +@@ -1755,73 +1948,72 @@ HWY_INLINE Vec128 LoadU(Simd< + // we don't actually care what is in it, and we don't want + // to introduce extra overhead by initializing it to something. + +-HWY_INLINE Vec128 LoadU(Simd d, ++HWY_INLINE Vec128 LoadU(Simd /*tag*/, + const uint8_t* HWY_RESTRICT p) { +- uint32x2_t a = Undefined(d).raw; ++ uint32x2_t a = Undefined(Simd()).raw; + uint32x2_t b = vld1_lane_u32(reinterpret_cast(p), a, 0); + return Vec128(vreinterpret_u8_u32(b)); + } +-HWY_INLINE Vec128 LoadU(Simd d, ++HWY_INLINE Vec128 LoadU(Simd /*tag*/, + const uint16_t* HWY_RESTRICT p) { +- uint32x2_t a = Undefined(d).raw; ++ uint32x2_t a = Undefined(Simd()).raw; + uint32x2_t b = vld1_lane_u32(reinterpret_cast(p), a, 0); + return Vec128(vreinterpret_u16_u32(b)); + } +-HWY_INLINE Vec128 LoadU(Simd d, ++HWY_INLINE Vec128 LoadU(Simd /*tag*/, + const uint32_t* HWY_RESTRICT p) { +- uint32x2_t a = Undefined(d).raw; ++ uint32x2_t a = Undefined(Simd()).raw; + uint32x2_t b = vld1_lane_u32(p, a, 0); + return Vec128(b); + } +-HWY_INLINE Vec128 LoadU(Simd d, ++HWY_INLINE Vec128 LoadU(Simd /*tag*/, + const int8_t* HWY_RESTRICT p) { +- int32x2_t a = Undefined(d).raw; ++ int32x2_t a = Undefined(Simd()).raw; + int32x2_t b = vld1_lane_s32(reinterpret_cast(p), a, 0); + return Vec128(vreinterpret_s8_s32(b)); + } +-HWY_INLINE Vec128 LoadU(Simd d, ++HWY_INLINE Vec128 LoadU(Simd /*tag*/, + const int16_t* HWY_RESTRICT p) { +- int32x2_t a = Undefined(d).raw; ++ int32x2_t a = Undefined(Simd()).raw; + int32x2_t b = vld1_lane_s32(reinterpret_cast(p), a, 0); + return Vec128(vreinterpret_s16_s32(b)); + } +-HWY_INLINE Vec128 LoadU(Simd d, ++HWY_INLINE Vec128 LoadU(Simd /*tag*/, + const int32_t* HWY_RESTRICT p) { +- int32x2_t a = Undefined(d).raw; ++ int32x2_t a = Undefined(Simd()).raw; + int32x2_t b = vld1_lane_s32(p, a, 0); + return Vec128(b); + } +-HWY_INLINE Vec128 LoadU(Simd d, ++HWY_INLINE Vec128 LoadU(Simd /*tag*/, + const float* HWY_RESTRICT p) { +- float32x2_t a = Undefined(d).raw; ++ float32x2_t a = Undefined(Simd()).raw; + float32x2_t b = vld1_lane_f32(p, a, 0); + return Vec128(b); + } + + // ------------------------------ Load 16 + +-HWY_INLINE Vec128 LoadU(Simd d, ++HWY_INLINE Vec128 LoadU(Simd /*tag*/, + const uint8_t* HWY_RESTRICT p) { +- uint16x4_t a = Undefined(d).raw; ++ uint16x4_t a = Undefined(Simd()).raw; + uint16x4_t b = vld1_lane_u16(reinterpret_cast(p), a, 0); + return Vec128(vreinterpret_u8_u16(b)); + } +-HWY_INLINE Vec128 LoadU(Simd d, ++HWY_INLINE Vec128 LoadU(Simd /*tag*/, + const uint16_t* HWY_RESTRICT p) { +- uint16x4_t a = Undefined(d).raw; ++ uint16x4_t a = Undefined(Simd()).raw; + uint16x4_t b = vld1_lane_u16(p, a, 0); + return Vec128(b); + } +- +-HWY_INLINE Vec128 LoadU(Simd d, ++HWY_INLINE Vec128 LoadU(Simd /*tag*/, + const int8_t* HWY_RESTRICT p) { +- int16x4_t a = Undefined(d).raw; ++ int16x4_t a = Undefined(Simd()).raw; + int16x4_t b = vld1_lane_s16(reinterpret_cast(p), a, 0); + return Vec128(vreinterpret_s8_s16(b)); + } +-HWY_INLINE Vec128 LoadU(Simd d, ++HWY_INLINE Vec128 LoadU(Simd /*tag*/, + const int16_t* HWY_RESTRICT p) { +- int16x4_t a = Undefined(d).raw; ++ int16x4_t a = Undefined(Simd()).raw; + int16x4_t b = vld1_lane_s16(p, a, 0); + return Vec128(b); + } +@@ -1902,7 +2094,7 @@ HWY_INLINE void StoreU(const Vec128 v, Full128 /* tag */, + double* HWY_RESTRICT aligned) { + vst1q_f64(aligned, v.raw); +@@ -1947,7 +2139,7 @@ HWY_INLINE void StoreU(const Vec128 v, Simd /* tag */, + double* HWY_RESTRICT p) { + vst1_f64(p, v.raw); +@@ -1959,12 +2151,12 @@ HWY_INLINE void StoreU(const Vec128 v, Simd, + uint8_t* HWY_RESTRICT p) { + uint32x2_t a = vreinterpret_u32_u8(v.raw); +- vst1_lane_u32(p, a, 0); ++ vst1_lane_u32(reinterpret_cast(p), a, 0); + } + HWY_INLINE void StoreU(const Vec128 v, Simd, + uint16_t* HWY_RESTRICT p) { + uint32x2_t a = vreinterpret_u32_u16(v.raw); +- vst1_lane_u32(p, a, 0); ++ vst1_lane_u32(reinterpret_cast(p), a, 0); + } + HWY_INLINE void StoreU(const Vec128 v, Simd, + uint32_t* HWY_RESTRICT p) { +@@ -1973,12 +2165,12 @@ HWY_INLINE void StoreU(const Vec128 v, Simd, + int8_t* HWY_RESTRICT p) { + int32x2_t a = vreinterpret_s32_s8(v.raw); +- vst1_lane_s32(p, a, 0); ++ vst1_lane_s32(reinterpret_cast(p), a, 0); + } + HWY_INLINE void StoreU(const Vec128 v, Simd, + int16_t* HWY_RESTRICT p) { + int32x2_t a = vreinterpret_s32_s16(v.raw); +- vst1_lane_s32(p, a, 0); ++ vst1_lane_s32(reinterpret_cast(p), a, 0); + } + HWY_INLINE void StoreU(const Vec128 v, Simd, + int32_t* HWY_RESTRICT p) { +@@ -1994,7 +2186,7 @@ HWY_INLINE void StoreU(const Vec128 v, Simd, + uint8_t* HWY_RESTRICT p) { + uint16x4_t a = vreinterpret_u16_u8(v.raw); +- vst1_lane_u16(p, a, 0); ++ vst1_lane_u16(reinterpret_cast(p), a, 0); + } + HWY_INLINE void StoreU(const Vec128 v, Simd, + uint16_t* HWY_RESTRICT p) { +@@ -2003,7 +2195,7 @@ HWY_INLINE void StoreU(const Vec128 v, Simd, + int8_t* HWY_RESTRICT p) { + int16x4_t a = vreinterpret_s16_s8(v.raw); +- vst1_lane_s16(p, a, 0); ++ vst1_lane_s16(reinterpret_cast(p), a, 0); + } + HWY_INLINE void StoreU(const Vec128 v, Simd, + int16_t* HWY_RESTRICT p) { +@@ -2068,18 +2260,18 @@ HWY_INLINE Vec128 PromoteTo(Fu + const Vec128 v) { + return Vec128(vmovl_u32(v.raw)); + } +-HWY_INLINE Vec128 PromoteTo(Full128 /* tag */, ++HWY_INLINE Vec128 PromoteTo(Full128 d, + const Vec128 v) { +- return Vec128(vmovl_u8(v.raw)); ++ return BitCast(d, Vec128(vmovl_u8(v.raw))); + } +-HWY_INLINE Vec128 PromoteTo(Full128 /* tag */, ++HWY_INLINE Vec128 PromoteTo(Full128 d, + const Vec128 v) { + uint16x8_t a = vmovl_u8(v.raw); +- return Vec128(vreinterpretq_s32_u16(vmovl_u16(vget_low_u16(a)))); ++ return BitCast(d, Vec128(vmovl_u16(vget_low_u16(a)))); + } +-HWY_INLINE Vec128 PromoteTo(Full128 /* tag */, ++HWY_INLINE Vec128 PromoteTo(Full128 d, + const Vec128 v) { +- return Vec128(vmovl_u16(v.raw)); ++ return BitCast(d, Vec128(vmovl_u16(v.raw))); + } + + // Unsigned: zero-extend to half vector. +@@ -2105,9 +2297,9 @@ HWY_INLINE Vec128 PromoteTo + return Vec128(vget_low_u64(vmovl_u32(v.raw))); + } + template +-HWY_INLINE Vec128 PromoteTo(Simd /* tag */, ++HWY_INLINE Vec128 PromoteTo(Simd d, + const Vec128 v) { +- return Vec128(vget_low_s16(vmovl_u8(v.raw))); ++ return BitCast(d, Vec128(vget_low_u16(vmovl_u8(v.raw)))); + } + template + HWY_INLINE Vec128 PromoteTo(Simd /* tag */, +@@ -2170,12 +2362,14 @@ HWY_INLINE Vec128 PromoteTo( + + HWY_INLINE Vec128 PromoteTo(Full128 /* tag */, + const Vec128 v) { +- return Vec128(vcvt_f32_f16(v.raw)); ++ const float32x4_t f32 = vcvt_f32_f16(vreinterpret_f16_u16(v.raw)); ++ return Vec128(f32); + } + template + HWY_INLINE Vec128 PromoteTo(Simd /* tag */, + const Vec128 v) { +- return Vec128(vget_low_f32(vcvt_f32_f16(v.raw))); ++ const float32x4_t f32 = vcvt_f32_f16(vreinterpret_f16_u16(v.raw)); ++ return Vec128(vget_low_f32(f32)); + } + + #else +@@ -2204,7 +2398,7 @@ HWY_INLINE Vec128 PromoteTo(Si + + #endif + +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + + HWY_INLINE Vec128 PromoteTo(Full128 /* tag */, + const Vec128 v) { +@@ -2298,12 +2492,13 @@ HWY_INLINE Vec128 DemoteTo(Si + + HWY_INLINE Vec128 DemoteTo(Simd /* tag */, + const Vec128 v) { +- return Vec128{vcvt_f16_f32(v.raw)}; ++ return Vec128{vreinterpret_u16_f16(vcvt_f16_f32(v.raw))}; + } + template + HWY_INLINE Vec128 DemoteTo(Simd /* tag */, + const Vec128 v) { +- return Vec128{vcvt_f16_f32(vcombine_f32(v.raw, v.raw))}; ++ const float16x4_t f16 = vcvt_f16_f32(vcombine_f32(v.raw, v.raw)); ++ return Vec128(vreinterpret_u16_f16(f16)); + } + + #else +@@ -2339,7 +2534,7 @@ HWY_INLINE Vec128 DemoteTo + } + + #endif +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + + HWY_INLINE Vec128 DemoteTo(Simd /* tag */, + const Vec128 v) { +@@ -2397,7 +2592,7 @@ HWY_INLINE Vec128 DemoteTo(Si + const Vec128 v) { + Vec128 a = DemoteTo(Simd(), v); + Vec128 b; +- uint16x8_t c = vcombine_s16(a.raw, b.raw); ++ int16x8_t c = vcombine_s16(a.raw, b.raw); + return Vec128(vqmovn_s16(c)); + } + +@@ -2426,7 +2621,7 @@ HWY_INLINE Vec128 ConvertTo( + return Vec128(vcvt_s32_f32(v.raw)); + } + +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + + HWY_INLINE Vec128 ConvertTo(Full128 /* tag */, + const Vec128 v) { +@@ -2451,7 +2646,7 @@ HWY_INLINE Vec128 ConvertTo( + + // ------------------------------ Round (IfThenElse, mask, logical) + +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + // Toward nearest integer + HWY_NEON_DEF_FUNCTION_ALL_FLOATS(Round, vrndn, _, 1) + +@@ -2472,18 +2667,26 @@ HWY_NEON_DEF_FUNCTION_ALL_FLOATS(Floor, + // representation, clearing the lowest 23-exp mantissa bits. This requires 9 + // integer operations and 3 constants, which is likely more expensive. + ++namespace detail { ++ ++// The original value is already the desired result if NaN or the magnitude is ++// large (i.e. the value is already an integer). ++template ++HWY_API Mask128 UseInt(const Vec128 v) { ++ return Abs(v) < Set(Simd(), MantissaEnd()); ++} ++ ++} // namespace detail ++ + template + HWY_INLINE Vec128 Trunc(const Vec128 v) { + const Simd df; +- const Simd di; ++ const RebindToSigned di; + + const auto integer = ConvertTo(di, v); // round toward 0 + const auto int_f = ConvertTo(df, integer); + +- // The original value is already the desired result if NaN or the magnitude is +- // large (i.e. the value is already an integer). +- const auto max = Set(df, MantissaEnd()); +- return IfThenElse(Abs(v) < max, int_f, v); ++ return IfThenElse(detail::UseInt(v), int_f, v); + } + + template +@@ -2506,7 +2709,7 @@ HWY_INLINE Vec128 Round(const + template + HWY_INLINE Vec128 Ceil(const Vec128 v) { + const Simd df; +- const Simd di; ++ const RebindToSigned di; + + const auto integer = ConvertTo(di, v); // round toward 0 + const auto int_f = ConvertTo(df, integer); +@@ -2514,9 +2717,7 @@ HWY_INLINE Vec128 Ceil(const V + // Truncating a positive non-integer ends up smaller; if so, add 1. + const auto neg1 = ConvertTo(df, VecFromMask(di, RebindMask(di, int_f < v))); + +- // Keep original if NaN or the magnitude is large (already an int). +- const auto max = Set(df, MantissaEnd()); +- return IfThenElse(Abs(v) < max, int_f - neg1, v); ++ return IfThenElse(detail::UseInt(v), int_f - neg1, v); + } + + template +@@ -2530,16 +2731,14 @@ HWY_INLINE Vec128 Floor(const + // Truncating a negative non-integer ends up larger; if so, subtract 1. + const auto neg1 = ConvertTo(df, VecFromMask(di, RebindMask(di, int_f > v))); + +- // Keep original if NaN or the magnitude is large (already an int). +- const auto max = Set(df, MantissaEnd()); +- return IfThenElse(Abs(v) < max, int_f + neg1, v); ++ return IfThenElse(detail::UseInt(v), int_f + neg1, v); + } + + #endif + + // ------------------------------ NearestInt (Round) + +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + + HWY_INLINE Vec128 NearestInt(const Vec128 v) { + return Vec128(vcvtnq_s32_f32(v.raw)); +@@ -2596,7 +2795,7 @@ HWY_INLINE Vec128 LowerHalf( + HWY_INLINE Vec128 LowerHalf(const Vec128 v) { + return Vec128(vget_low_f32(v.raw)); + } +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + HWY_INLINE Vec128 LowerHalf(const Vec128 v) { + return Vec128(vget_low_f64(v.raw)); + } +@@ -2629,7 +2828,7 @@ HWY_INLINE Vec128 UpperHalf( + HWY_INLINE Vec128 UpperHalf(const Vec128 v) { + return Vec128(vget_high_f32(v.raw)); + } +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + HWY_INLINE Vec128 UpperHalf(const Vec128 v) { + return Vec128(vget_high_f64(v.raw)); + } +@@ -2714,7 +2913,7 @@ HWY_INLINE Vec128 ShiftRightLanes( + + // ------------------------------ Broadcast/splat any lane + +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + // Unsigned + template + HWY_INLINE Vec128 Broadcast(const Vec128 v) { +@@ -2886,7 +3085,7 @@ HWY_API Vec128 TableLookupBytes(const + const Vec128 from) { + const Full128 d; + const Repartition d8; +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + return BitCast(d, Vec128(vqtbl1q_u8(BitCast(d8, bytes).raw, + BitCast(d8, from).raw))); + #else +@@ -2911,33 +3110,58 @@ HWY_INLINE Vec128 TableLookupBytes + BitCast(d8, from).raw))); + } + +-// ------------------------------ Hard-coded shuffles ++// ------------------------------ TableLookupLanes + +-// Notation: let Vec128 have lanes 3,2,1,0 (0 is least-significant). +-// Shuffle0321 rotates one lane to the right (the previous least-significant +-// lane is now most-significant). These could also be implemented via +-// CombineShiftRightBytes but the shuffle_abcd notation is more convenient. ++// Returned by SetTableIndices for use by TableLookupLanes. ++template ++struct Indices128 { ++ typename detail::Raw128::type raw; ++}; + +-// Swap 32-bit halves in 64-bits +-HWY_INLINE Vec128 Shuffle2301(const Vec128 v) { +- return Vec128(vrev64_u32(v.raw)); +-} +-HWY_INLINE Vec128 Shuffle2301(const Vec128 v) { +- return Vec128(vrev64_s32(v.raw)); +-} +-HWY_INLINE Vec128 Shuffle2301(const Vec128 v) { +- return Vec128(vrev64_f32(v.raw)); ++template ++HWY_INLINE Indices128 SetTableIndices(Simd d, const int32_t* idx) { ++#if !defined(NDEBUG) || defined(ADDRESS_SANITIZER) ++ for (size_t i = 0; i < N; ++i) { ++ HWY_DASSERT(0 <= idx[i] && idx[i] < static_cast(N)); ++ } ++#endif ++ ++ const Repartition d8; ++ alignas(16) uint8_t control[16] = {0}; ++ for (size_t idx_lane = 0; idx_lane < N; ++idx_lane) { ++ for (size_t idx_byte = 0; idx_byte < sizeof(T); ++idx_byte) { ++ control[idx_lane * sizeof(T) + idx_byte] = ++ static_cast(idx[idx_lane] * sizeof(T) + idx_byte); ++ } ++ } ++ return Indices128{BitCast(d, Load(d8, control)).raw}; + } +-HWY_INLINE Vec128 Shuffle2301(const Vec128 v) { +- return Vec128(vrev64q_u32(v.raw)); ++ ++template ++HWY_INLINE Vec128 TableLookupLanes( ++ const Vec128 v, const Indices128 idx) { ++ return TableLookupBytes(v, Vec128{idx.raw}); + } +-HWY_INLINE Vec128 Shuffle2301(const Vec128 v) { +- return Vec128(vrev64q_s32(v.raw)); ++template ++HWY_INLINE Vec128 TableLookupLanes( ++ const Vec128 v, const Indices128 idx) { ++ return TableLookupBytes(v, Vec128{idx.raw}); + } +-HWY_INLINE Vec128 Shuffle2301(const Vec128 v) { +- return Vec128(vrev64q_f32(v.raw)); ++template ++HWY_INLINE Vec128 TableLookupLanes(const Vec128 v, ++ const Indices128 idx) { ++ const Simd di; ++ const auto idx_i = BitCast(di, Vec128{idx.raw}); ++ return BitCast(Simd(), TableLookupBytes(BitCast(di, v), idx_i)); + } + ++// ------------------------------ Other shuffles (TableLookupBytes) ++ ++// Notation: let Vec128 have lanes 3,2,1,0 (0 is least-significant). ++// Shuffle0321 rotates one lane to the right (the previous least-significant ++// lane is now most-significant). These could also be implemented via ++// CombineShiftRightBytes but the shuffle_abcd notation is more convenient. ++ + // Swap 64-bit halves + template + HWY_INLINE Vec128 Shuffle1032(const Vec128 v) { +@@ -2975,49 +3199,6 @@ HWY_INLINE Vec128 Shuffle0123(const V + return TableLookupBytes(v, BitCast(d, Load(d8, bytes))); + } + +-// ------------------------------ TableLookupLanes +- +-// Returned by SetTableIndices for use by TableLookupLanes. +-template +-struct Indices128 { +- uint8x16_t raw; +-}; +- +-template +-HWY_INLINE Indices128 SetTableIndices(const Full128, const int32_t* idx) { +-#if !defined(NDEBUG) || defined(ADDRESS_SANITIZER) +- const size_t N = 16 / sizeof(T); +- for (size_t i = 0; i < N; ++i) { +- HWY_DASSERT(0 <= idx[i] && idx[i] < static_cast(N)); +- } +-#endif +- +- const Full128 d8; +- alignas(16) uint8_t control[16]; +- for (size_t idx_byte = 0; idx_byte < 16; ++idx_byte) { +- const size_t idx_lane = idx_byte / sizeof(T); +- const size_t mod = idx_byte % sizeof(T); +- control[idx_byte] = idx[idx_lane] * sizeof(T) + mod; +- } +- return Indices128{Load(d8, control).raw}; +-} +- +-HWY_INLINE Vec128 TableLookupLanes(const Vec128 v, +- const Indices128 idx) { +- return TableLookupBytes(v, Vec128(idx.raw)); +-} +-HWY_INLINE Vec128 TableLookupLanes(const Vec128 v, +- const Indices128 idx) { +- return TableLookupBytes(v, Vec128(idx.raw)); +-} +-HWY_INLINE Vec128 TableLookupLanes(const Vec128 v, +- const Indices128 idx) { +- const Full128 di; +- const Full128 df; +- return BitCast(df, +- TableLookupBytes(BitCast(di, v), Vec128(idx.raw))); +-} +- + // ------------------------------ Interleave lanes + + // Interleaves lanes from halves of the 128-bit blocks of "a" (which provides +@@ -3029,7 +3210,7 @@ HWY_NEON_DEF_FUNCTION_UINT_8_16_32(Inter + HWY_NEON_DEF_FUNCTION_INT_8_16_32(InterleaveUpper, vzip2, _, 2) + HWY_NEON_DEF_FUNCTION_UINT_8_16_32(InterleaveUpper, vzip2, _, 2) + +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + // For 64 bit types, we only have the "q" version of the function defined as + // interleaving 64-wide registers with 64-wide types in them makes no sense. + HWY_INLINE Vec128 InterleaveLower(const Vec128 a, +@@ -3079,7 +3260,7 @@ HWY_INLINE Vec128 InterleaveLower + const Vec128 b) { + return Vec128(vzip1q_f32(a.raw, b.raw)); + } +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + HWY_INLINE Vec128 InterleaveLower(const Vec128 a, + const Vec128 b) { + return Vec128(vzip1q_f64(a.raw, b.raw)); +@@ -3090,10 +3271,10 @@ HWY_INLINE Vec128 InterleaveUpper + const Vec128 b) { + return Vec128(vzip2q_f32(a.raw, b.raw)); + } +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + HWY_INLINE Vec128 InterleaveUpper(const Vec128 a, + const Vec128 b) { +- return Vec128(vzip2q_s64(a.raw, b.raw)); ++ return Vec128(vzip2q_f64(a.raw, b.raw)); + } + #endif + +@@ -3105,119 +3286,125 @@ HWY_INLINE Vec128 InterleaveUppe + // Full vectors + HWY_INLINE Vec128 ZipLower(const Vec128 a, + const Vec128 b) { +- return Vec128(vzip1q_u8(a.raw, b.raw)); ++ return Vec128(vreinterpretq_u16_u8(vzip1q_u8(a.raw, b.raw))); + } + HWY_INLINE Vec128 ZipLower(const Vec128 a, + const Vec128 b) { +- return Vec128(vzip1q_u16(a.raw, b.raw)); ++ return Vec128(vreinterpretq_u32_u16(vzip1q_u16(a.raw, b.raw))); + } + HWY_INLINE Vec128 ZipLower(const Vec128 a, + const Vec128 b) { +- return Vec128(vzip1q_u32(a.raw, b.raw)); ++ return Vec128(vreinterpretq_u64_u32(vzip1q_u32(a.raw, b.raw))); + } + + HWY_INLINE Vec128 ZipLower(const Vec128 a, + const Vec128 b) { +- return Vec128(vzip1q_s8(a.raw, b.raw)); ++ return Vec128(vreinterpretq_s16_s8(vzip1q_s8(a.raw, b.raw))); + } + HWY_INLINE Vec128 ZipLower(const Vec128 a, + const Vec128 b) { +- return Vec128(vzip1q_s16(a.raw, b.raw)); ++ return Vec128(vreinterpretq_s32_s16(vzip1q_s16(a.raw, b.raw))); + } + HWY_INLINE Vec128 ZipLower(const Vec128 a, + const Vec128 b) { +- return Vec128(vzip1q_s32(a.raw, b.raw)); ++ return Vec128(vreinterpretq_s64_s32(vzip1q_s32(a.raw, b.raw))); + } + + HWY_INLINE Vec128 ZipUpper(const Vec128 a, + const Vec128 b) { +- return Vec128(vzip2q_u8(a.raw, b.raw)); ++ return Vec128(vreinterpretq_u16_u8(vzip2q_u8(a.raw, b.raw))); + } + HWY_INLINE Vec128 ZipUpper(const Vec128 a, + const Vec128 b) { +- return Vec128(vzip2q_u16(a.raw, b.raw)); ++ return Vec128(vreinterpretq_u32_u16(vzip2q_u16(a.raw, b.raw))); + } + HWY_INLINE Vec128 ZipUpper(const Vec128 a, + const Vec128 b) { +- return Vec128(vzip2q_u32(a.raw, b.raw)); ++ return Vec128(vreinterpretq_u64_u32(vzip2q_u32(a.raw, b.raw))); + } + + HWY_INLINE Vec128 ZipUpper(const Vec128 a, + const Vec128 b) { +- return Vec128(vzip2q_s8(a.raw, b.raw)); ++ return Vec128(vreinterpretq_s16_s8(vzip2q_s8(a.raw, b.raw))); + } + HWY_INLINE Vec128 ZipUpper(const Vec128 a, + const Vec128 b) { +- return Vec128(vzip2q_s16(a.raw, b.raw)); ++ return Vec128(vreinterpretq_s32_s16(vzip2q_s16(a.raw, b.raw))); + } + HWY_INLINE Vec128 ZipUpper(const Vec128 a, + const Vec128 b) { +- return Vec128(vzip2q_s32(a.raw, b.raw)); ++ return Vec128(vreinterpretq_s64_s32(vzip2q_s32(a.raw, b.raw))); + } + + // Half vectors or less + template + HWY_INLINE Vec128 ZipLower(const Vec128 a, + const Vec128 b) { +- return Vec128(vzip1_u8(a.raw, b.raw)); ++ return Vec128( ++ vreinterpret_u16_u8(vzip1_u8(a.raw, b.raw))); + } + template + HWY_INLINE Vec128 ZipLower(const Vec128 a, + const Vec128 b) { +- return Vec128(vzip1_u16(a.raw, b.raw)); ++ return Vec128( ++ vreinterpret_u32_u16(vzip1_u16(a.raw, b.raw))); + } + template + HWY_INLINE Vec128 ZipLower(const Vec128 a, + const Vec128 b) { +- return Vec128(vzip1_u32(a.raw, b.raw)); ++ return Vec128( ++ vreinterpret_u64_u32(vzip1_u32(a.raw, b.raw))); + } + + template + HWY_INLINE Vec128 ZipLower(const Vec128 a, + const Vec128 b) { +- return Vec128(vzip1_s8(a.raw, b.raw)); ++ return Vec128( ++ vreinterpret_s16_s8(vzip1_s8(a.raw, b.raw))); + } + template + HWY_INLINE Vec128 ZipLower(const Vec128 a, + const Vec128 b) { +- return Vec128(vzip1_s16(a.raw, b.raw)); ++ return Vec128( ++ vreinterpret_s32_s16(vzip1_s16(a.raw, b.raw))); + } + template + HWY_INLINE Vec128 ZipLower(const Vec128 a, + const Vec128 b) { +- return Vec128(vzip1_s32(a.raw, b.raw)); ++ return Vec128( ++ vreinterpret_s64_s32(vzip1_s32(a.raw, b.raw))); + } + + template + HWY_INLINE Vec128 ZipUpper(const Vec128 a, + const Vec128 b) { +- return Vec128(vzip2_u8(a.raw, b.raw)); ++ return Vec128(vreinterpret_u16_u8(vzip2_u8(a.raw, b.raw))); + } + template + HWY_INLINE Vec128 ZipUpper(const Vec128 a, + const Vec128 b) { +- return Vec128(vzip2_u16(a.raw, b.raw)); ++ return Vec128(vreinterpret_u32_u16(vzip2_u16(a.raw, b.raw))); + } + template + HWY_INLINE Vec128 ZipUpper(const Vec128 a, + const Vec128 b) { +- return Vec128(vzip2_u32(a.raw, b.raw)); ++ return Vec128(vreinterpret_u64_u32(vzip2_u32(a.raw, b.raw))); + } + + template + HWY_INLINE Vec128 ZipUpper(const Vec128 a, + const Vec128 b) { +- return Vec128(vzip2_s8(a.raw, b.raw)); ++ return Vec128(vreinterpret_s16_s8(vzip2_s8(a.raw, b.raw))); + } + template + HWY_INLINE Vec128 ZipUpper(const Vec128 a, + const Vec128 b) { +- return Vec128(vzip2_s16(a.raw, b.raw)); ++ return Vec128(vreinterpret_s32_s16(vzip2_s16(a.raw, b.raw))); + } + template + HWY_INLINE Vec128 ZipUpper(const Vec128 a, + const Vec128 b) { +- return Vec128(vzip2_s32(a.raw, b.raw)); ++ return Vec128(vreinterpret_s64_s32(vzip2_s32(a.raw, b.raw))); + } + + // ------------------------------ Blocks +@@ -3274,84 +3461,113 @@ HWY_INLINE Vec128 OddEven(const Vec12 + + // ================================================== MISC + +-// Returns a vector with lane i=[0, N) set to "first" + i. +-template +-Vec128 Iota(const Simd d, const T2 first) { +- HWY_ALIGN T lanes[16 / sizeof(T)]; +- for (size_t i = 0; i < 16 / sizeof(T); ++i) { +- lanes[i] = static_cast(first + static_cast(i)); ++// ------------------------------ Scatter (Store) ++ ++template ++HWY_API void ScatterOffset(Vec128 v, Simd d, T* HWY_RESTRICT base, ++ const Vec128 offset) { ++ static_assert(sizeof(T) == sizeof(Offset), "Must match for portability"); ++ ++ alignas(16) T lanes[N]; ++ Store(v, d, lanes); ++ ++ alignas(16) Offset offset_lanes[N]; ++ Store(offset, Simd(), offset_lanes); ++ ++ uint8_t* base_bytes = reinterpret_cast(base); ++ for (size_t i = 0; i < N; ++i) { ++ CopyBytes(&lanes[i], base_bytes + offset_lanes[i]); ++ } ++} ++ ++template ++HWY_API void ScatterIndex(Vec128 v, Simd d, T* HWY_RESTRICT base, ++ const Vec128 index) { ++ static_assert(sizeof(T) == sizeof(Index), "Must match for portability"); ++ ++ alignas(16) T lanes[N]; ++ Store(v, d, lanes); ++ ++ alignas(16) Index index_lanes[N]; ++ Store(index, Simd(), index_lanes); ++ ++ for (size_t i = 0; i < N; ++i) { ++ base[index_lanes[i]] = lanes[i]; + } +- return Load(d, lanes); + } + +-// ------------------------------ Gather (requires GetLane) ++// ------------------------------ Gather (Load/Store) + + template + HWY_API Vec128 GatherOffset(const Simd d, + const T* HWY_RESTRICT base, + const Vec128 offset) { +- static_assert(N == 1, "NEON does not support full gather"); +- static_assert(sizeof(T) == sizeof(Offset), "T must match Offset"); +- const uintptr_t address = reinterpret_cast(base) + GetLane(offset); +- T val; +- CopyBytes(reinterpret_cast(address), &val); +- return Set(d, val); ++ static_assert(sizeof(T) == sizeof(Offset), "Must match for portability"); ++ ++ alignas(16) Offset offset_lanes[N]; ++ Store(offset, Simd(), offset_lanes); ++ ++ alignas(16) T lanes[N]; ++ const uint8_t* base_bytes = reinterpret_cast(base); ++ for (size_t i = 0; i < N; ++i) { ++ CopyBytes(base_bytes + offset_lanes[i], &lanes[i]); ++ } ++ return Load(d, lanes); + } + + template + HWY_API Vec128 GatherIndex(const Simd d, const T* HWY_RESTRICT base, + const Vec128 index) { +- static_assert(N == 1, "NEON does not support full gather"); +- static_assert(sizeof(T) == sizeof(Index), "T must match Index"); +- return Set(d, base[GetLane(index)]); ++ static_assert(sizeof(T) == sizeof(Index), "Must match for portability"); ++ ++ alignas(16) Index index_lanes[N]; ++ Store(index, Simd(), index_lanes); ++ ++ alignas(16) T lanes[N]; ++ for (size_t i = 0; i < N; ++i) { ++ lanes[i] = base[index_lanes[i]]; ++ } ++ return Load(d, lanes); + } + +-// ------------------------------ ARMv7 int64 comparisons (requires Shuffle2301) ++// ------------------------------ Reductions + +-#if !defined(__aarch64__) ++namespace detail { + +-template +-HWY_INLINE Mask128 operator==(const Vec128 a, +- const Vec128 b) { +- const Simd d32; +- const Simd d64; +- const auto cmp32 = VecFromMask(d32, BitCast(d32, a) == BitCast(d32, b)); +- const auto cmp64 = cmp32 & Shuffle2301(cmp32); +- return MaskFromVec(BitCast(d64, cmp64)); ++// N=1 for any T: no-op ++template ++HWY_API Vec128 SumOfLanes(const Vec128 v) { ++ return v; + } +- +-template +-HWY_INLINE Mask128 operator==(const Vec128 a, +- const Vec128 b) { +- const Simd d32; +- const Simd d64; +- const auto cmp32 = VecFromMask(d32, BitCast(d32, a) == BitCast(d32, b)); +- const auto cmp64 = cmp32 & Shuffle2301(cmp32); +- return MaskFromVec(BitCast(d64, cmp64)); ++template ++HWY_API Vec128 MinOfLanes(hwy::SizeTag /* tag */, ++ const Vec128 v) { ++ return v; ++} ++template ++HWY_API Vec128 MaxOfLanes(hwy::SizeTag /* tag */, ++ const Vec128 v) { ++ return v; + } + +-HWY_INLINE Mask128 operator<(const Vec128 a, +- const Vec128 b) { +- const int64x2_t sub = vqsubq_s64(a.raw, b.raw); +- return MaskFromVec(BroadcastSignBit(Vec128(sub))); ++// u32/i32/f32: N=2 ++template ++HWY_API Vec128 SumOfLanes(const Vec128 v10) { ++ return v10 + Shuffle2301(v10); + } +-HWY_INLINE Mask128 operator<(const Vec128 a, +- const Vec128 b) { +- const int64x1_t sub = vqsub_s64(a.raw, b.raw); +- return MaskFromVec(BroadcastSignBit(Vec128(sub))); ++template ++HWY_API Vec128 MinOfLanes(hwy::SizeTag<4> /* tag */, ++ const Vec128 v10) { ++ return Min(v10, Shuffle2301(v10)); + } +- +-template +-HWY_INLINE Mask128 operator>(const Vec128 a, +- const Vec128 b) { +- return b < a; ++template ++HWY_API Vec128 MaxOfLanes(hwy::SizeTag<4> /* tag */, ++ const Vec128 v10) { ++ return Max(v10, Shuffle2301(v10)); + } +-#endif +- +-// ------------------------------ Reductions + +-#if defined(__aarch64__) +-// Supported for 32b and 64b vector types. Returns the sum in each lane. ++// full vectors ++#if HWY_ARCH_ARM_A64 + HWY_INLINE Vec128 SumOfLanes(const Vec128 v) { + return Vec128(vdupq_n_u32(vaddvq_u32(v.raw))); + } +@@ -3398,20 +3614,15 @@ HWY_INLINE Vec128 SumOfLanes(co + } + #endif + +-namespace detail { +- +-// For u32/i32/f32. +-template +-HWY_API Vec128 MinOfLanes(hwy::SizeTag<4> /* tag */, +- const Vec128 v3210) { ++template ++HWY_API Vec128 MinOfLanes(hwy::SizeTag<4> /* tag */, const Vec128 v3210) { + const Vec128 v1032 = Shuffle1032(v3210); + const Vec128 v31_20_31_20 = Min(v3210, v1032); + const Vec128 v20_31_20_31 = Shuffle0321(v31_20_31_20); + return Min(v20_31_20_31, v31_20_31_20); + } +-template +-HWY_API Vec128 MaxOfLanes(hwy::SizeTag<4> /* tag */, +- const Vec128 v3210) { ++template ++HWY_API Vec128 MaxOfLanes(hwy::SizeTag<4> /* tag */, const Vec128 v3210) { + const Vec128 v1032 = Shuffle1032(v3210); + const Vec128 v31_20_31_20 = Max(v3210, v1032); + const Vec128 v20_31_20_31 = Shuffle0321(v31_20_31_20); +@@ -3419,15 +3630,13 @@ HWY_API Vec128 MaxOfLanes(hwy::Siz + } + + // For u64/i64[/f64]. +-template +-HWY_API Vec128 MinOfLanes(hwy::SizeTag<8> /* tag */, +- const Vec128 v10) { ++template ++HWY_API Vec128 MinOfLanes(hwy::SizeTag<8> /* tag */, const Vec128 v10) { + const Vec128 v01 = Shuffle01(v10); + return Min(v10, v01); + } +-template +-HWY_API Vec128 MaxOfLanes(hwy::SizeTag<8> /* tag */, +- const Vec128 v10) { ++template ++HWY_API Vec128 MaxOfLanes(hwy::SizeTag<8> /* tag */, const Vec128 v10) { + const Vec128 v01 = Shuffle01(v10); + return Max(v10, v01); + } +@@ -3435,6 +3644,10 @@ HWY_API Vec128 MaxOfLanes(hwy::Siz + } // namespace detail + + template ++HWY_API Vec128 SumOfLanes(const Vec128 v) { ++ return detail::SumOfLanes(v); ++} ++template + HWY_API Vec128 MinOfLanes(const Vec128 v) { + return detail::MinOfLanes(hwy::SizeTag(), v); + } +@@ -3457,18 +3670,18 @@ HWY_INLINE uint64_t BitsFromMask(hwy::Si + const Vec128 values = + BitCast(du, VecFromMask(Full128(), mask)) & Load(du, kSliceLanes); + +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + // Can't vaddv - we need two separate bytes (16 bits). + const uint8x8_t x2 = vget_low_u8(vpaddq_u8(values.raw, values.raw)); + const uint8x8_t x4 = vpadd_u8(x2, x2); + const uint8x8_t x8 = vpadd_u8(x4, x4); +- return vreinterpret_u16_u8(x8)[0]; ++ return vget_lane_u64(vreinterpret_u64_u8(x8), 0); + #else + // Don't have vpaddq, so keep doubling lane size. + const uint16x8_t x2 = vpaddlq_u8(values.raw); + const uint32x4_t x4 = vpaddlq_u16(x2); + const uint64x2_t x8 = vpaddlq_u32(x4); +- return (uint64_t(x8[1]) << 8) | x8[0]; ++ return (vgetq_lane_u64(x8, 1) << 8) | vgetq_lane_u64(x8, 0); + #endif + } + +@@ -3484,7 +3697,7 @@ HWY_INLINE uint64_t BitsFromMask(hwy::Si + const Vec128 slice(Load(Simd(), kSliceLanes).raw); + const Vec128 values = BitCast(du, VecFromMask(d, mask)) & slice; + +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + return vaddv_u8(values.raw); + #else + const uint16x4_t x2 = vpaddl_u8(values.raw); +@@ -3503,7 +3716,7 @@ HWY_INLINE uint64_t BitsFromMask(hwy::Si + const Full128 du; + const Vec128 values = + BitCast(du, VecFromMask(d, mask)) & Load(du, kSliceLanes); +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + return vaddvq_u16(values.raw); + #else + const uint32x4_t x2 = vpaddlq_u16(values.raw); +@@ -3522,7 +3735,7 @@ HWY_INLINE uint64_t BitsFromMask(hwy::Si + const Simd du; + const Vec128 slice(Load(Simd(), kSliceLanes).raw); + const Vec128 values = BitCast(du, VecFromMask(d, mask)) & slice; +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + return vaddv_u16(values.raw); + #else + const uint32x2_t x2 = vpaddl_u16(values.raw); +@@ -3539,7 +3752,7 @@ HWY_INLINE uint64_t BitsFromMask(hwy::Si + const Full128 du; + const Vec128 values = + BitCast(du, VecFromMask(d, mask)) & Load(du, kSliceLanes); +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + return vaddvq_u32(values.raw); + #else + const uint64x2_t x2 = vpaddlq_u32(values.raw); +@@ -3557,7 +3770,7 @@ HWY_INLINE uint64_t BitsFromMask(hwy::Si + const Simd du; + const Vec128 slice(Load(Simd(), kSliceLanes).raw); + const Vec128 values = BitCast(du, VecFromMask(d, mask)) & slice; +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + return vaddv_u32(values.raw); + #else + const uint64x1_t x2 = vpaddl_u32(values.raw); +@@ -3572,7 +3785,7 @@ HWY_INLINE uint64_t BitsFromMask(hwy::Si + const Full128 du; + const Vec128 values = + BitCast(du, VecFromMask(d, m)) & Load(du, kSliceLanes); +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + return vaddvq_u64(values.raw); + #else + return vgetq_lane_u64(values.raw, 0) + vgetq_lane_u64(values.raw, 1); +@@ -3612,13 +3825,13 @@ HWY_INLINE size_t CountTrue(hwy::SizeTag + const int8x16_t ones = + vnegq_s8(BitCast(di, VecFromMask(Full128(), mask)).raw); + +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + return vaddvq_s8(ones); + #else + const int16x8_t x2 = vpaddlq_s8(ones); + const int32x4_t x4 = vpaddlq_s16(x2); + const int64x2_t x8 = vpaddlq_s32(x4); +- return x8[0] + x8[1]; ++ return vgetq_lane_s64(x8, 0) + vgetq_lane_s64(x8, 1); + #endif + } + template +@@ -3627,12 +3840,12 @@ HWY_INLINE size_t CountTrue(hwy::SizeTag + const int16x8_t ones = + vnegq_s16(BitCast(di, VecFromMask(Full128(), mask)).raw); + +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + return vaddvq_s16(ones); + #else + const int32x4_t x2 = vpaddlq_s16(ones); + const int64x2_t x4 = vpaddlq_s32(x2); +- return x4[0] + x4[1]; ++ return vgetq_lane_s64(x4, 0) + vgetq_lane_s64(x4, 1); + #endif + } + +@@ -3642,26 +3855,26 @@ HWY_INLINE size_t CountTrue(hwy::SizeTag + const int32x4_t ones = + vnegq_s32(BitCast(di, VecFromMask(Full128(), mask)).raw); + +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + return vaddvq_s32(ones); + #else + const int64x2_t x2 = vpaddlq_s32(ones); +- return x2[0] + x2[1]; ++ return vgetq_lane_s64(x2, 0) + vgetq_lane_s64(x2, 1); + #endif + } + + template + HWY_INLINE size_t CountTrue(hwy::SizeTag<8> /*tag*/, const Mask128 mask) { +-#if defined(__aarch64__) ++#if HWY_ARCH_ARM_A64 + const Full128 di; + const int64x2_t ones = + vnegq_s64(BitCast(di, VecFromMask(Full128(), mask)).raw); + return vaddvq_s64(ones); + #else +- const Full128 di; +- const int64x2_t ones = +- vshrq_n_u64(BitCast(di, VecFromMask(Full128(), mask)).raw, 63); +- return ones[0] + ones[1]; ++ const Full128 du; ++ const auto mask_u = VecFromMask(du, RebindMask(du, mask)); ++ const uint64x2_t ones = vshrq_n_u64(mask_u.raw, 63); ++ return vgetq_lane_u64(ones, 0) + vgetq_lane_u64(ones, 1); + #endif + } + +@@ -3690,9 +3903,15 @@ HWY_INLINE size_t StoreMaskBits(const Ma + // Full + template + HWY_INLINE bool AllFalse(const Mask128 m) { ++#if HWY_ARCH_ARM_A64 ++ const Full128 d32; ++ const auto m32 = MaskFromVec(BitCast(d32, VecFromMask(Full128(), m))); ++ return (vmaxvq_u32(m32.raw) == 0); ++#else + const auto v64 = BitCast(Full128(), VecFromMask(Full128(), m)); + uint32x2_t a = vqmovn_u64(v64.raw); +- return vreinterpret_u64_u32(a)[0] == 0; ++ return vget_lane_u64(vreinterpret_u64_u32(a), 0) == 0; ++#endif + } + + // Partial +@@ -3711,8 +3930,160 @@ HWY_INLINE bool AllTrue(const Mask128 Load8Bytes(Full128 /*d*/, ++ const uint8_t* bytes) { ++ return Vec128(vreinterpretq_u8_u64( ++ vld1q_dup_u64(reinterpret_cast(bytes)))); ++} ++ ++// Load 8 bytes and return half-reg with N <= 8 bytes. ++template ++HWY_INLINE Vec128 Load8Bytes(Simd d, ++ const uint8_t* bytes) { ++ return Load(d, bytes); ++} ++ + template +-HWY_INLINE Vec128 Idx32x4FromBits(const uint64_t mask_bits) { ++HWY_INLINE Vec128 IdxFromBits(hwy::SizeTag<2> /*tag*/, ++ const uint64_t mask_bits) { ++ HWY_DASSERT(mask_bits < 256); ++ const Simd d; ++ const Repartition d8; ++ const Simd du; ++ ++ // ARM does not provide an equivalent of AVX2 permutevar, so we need byte ++ // indices for VTBL (one vector's worth for each of 256 combinations of ++ // 8 mask bits). Loading them directly would require 4 KiB. We can instead ++ // store lane indices and convert to byte indices (2*lane + 0..1), with the ++ // doubling baked into the table. AVX2 Compress32 stores eight 4-bit lane ++ // indices (total 1 KiB), broadcasts them into each 32-bit lane and shifts. ++ // Here, 16-bit lanes are too narrow to hold all bits, and unpacking nibbles ++ // is likely more costly than the higher cache footprint from storing bytes. ++ alignas(16) constexpr uint8_t table[256 * 8] = { ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, ++ 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, ++ 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, ++ 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, ++ 0, 6, 0, 0, 0, 0, 0, 0, 2, 6, 0, 0, 0, 0, 0, 0, 0, 2, ++ 6, 0, 0, 0, 0, 0, 4, 6, 0, 0, 0, 0, 0, 0, 0, 4, 6, 0, ++ 0, 0, 0, 0, 2, 4, 6, 0, 0, 0, 0, 0, 0, 2, 4, 6, 0, 0, ++ 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, ++ 2, 8, 0, 0, 0, 0, 0, 0, 0, 2, 8, 0, 0, 0, 0, 0, 4, 8, ++ 0, 0, 0, 0, 0, 0, 0, 4, 8, 0, 0, 0, 0, 0, 2, 4, 8, 0, ++ 0, 0, 0, 0, 0, 2, 4, 8, 0, 0, 0, 0, 6, 8, 0, 0, 0, 0, ++ 0, 0, 0, 6, 8, 0, 0, 0, 0, 0, 2, 6, 8, 0, 0, 0, 0, 0, ++ 0, 2, 6, 8, 0, 0, 0, 0, 4, 6, 8, 0, 0, 0, 0, 0, 0, 4, ++ 6, 8, 0, 0, 0, 0, 2, 4, 6, 8, 0, 0, 0, 0, 0, 2, 4, 6, ++ 8, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, ++ 0, 0, 2, 10, 0, 0, 0, 0, 0, 0, 0, 2, 10, 0, 0, 0, 0, 0, ++ 4, 10, 0, 0, 0, 0, 0, 0, 0, 4, 10, 0, 0, 0, 0, 0, 2, 4, ++ 10, 0, 0, 0, 0, 0, 0, 2, 4, 10, 0, 0, 0, 0, 6, 10, 0, 0, ++ 0, 0, 0, 0, 0, 6, 10, 0, 0, 0, 0, 0, 2, 6, 10, 0, 0, 0, ++ 0, 0, 0, 2, 6, 10, 0, 0, 0, 0, 4, 6, 10, 0, 0, 0, 0, 0, ++ 0, 4, 6, 10, 0, 0, 0, 0, 2, 4, 6, 10, 0, 0, 0, 0, 0, 2, ++ 4, 6, 10, 0, 0, 0, 8, 10, 0, 0, 0, 0, 0, 0, 0, 8, 10, 0, ++ 0, 0, 0, 0, 2, 8, 10, 0, 0, 0, 0, 0, 0, 2, 8, 10, 0, 0, ++ 0, 0, 4, 8, 10, 0, 0, 0, 0, 0, 0, 4, 8, 10, 0, 0, 0, 0, ++ 2, 4, 8, 10, 0, 0, 0, 0, 0, 2, 4, 8, 10, 0, 0, 0, 6, 8, ++ 10, 0, 0, 0, 0, 0, 0, 6, 8, 10, 0, 0, 0, 0, 2, 6, 8, 10, ++ 0, 0, 0, 0, 0, 2, 6, 8, 10, 0, 0, 0, 4, 6, 8, 10, 0, 0, ++ 0, 0, 0, 4, 6, 8, 10, 0, 0, 0, 2, 4, 6, 8, 10, 0, 0, 0, ++ 0, 2, 4, 6, 8, 10, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 12, ++ 0, 0, 0, 0, 0, 0, 2, 12, 0, 0, 0, 0, 0, 0, 0, 2, 12, 0, ++ 0, 0, 0, 0, 4, 12, 0, 0, 0, 0, 0, 0, 0, 4, 12, 0, 0, 0, ++ 0, 0, 2, 4, 12, 0, 0, 0, 0, 0, 0, 2, 4, 12, 0, 0, 0, 0, ++ 6, 12, 0, 0, 0, 0, 0, 0, 0, 6, 12, 0, 0, 0, 0, 0, 2, 6, ++ 12, 0, 0, 0, 0, 0, 0, 2, 6, 12, 0, 0, 0, 0, 4, 6, 12, 0, ++ 0, 0, 0, 0, 0, 4, 6, 12, 0, 0, 0, 0, 2, 4, 6, 12, 0, 0, ++ 0, 0, 0, 2, 4, 6, 12, 0, 0, 0, 8, 12, 0, 0, 0, 0, 0, 0, ++ 0, 8, 12, 0, 0, 0, 0, 0, 2, 8, 12, 0, 0, 0, 0, 0, 0, 2, ++ 8, 12, 0, 0, 0, 0, 4, 8, 12, 0, 0, 0, 0, 0, 0, 4, 8, 12, ++ 0, 0, 0, 0, 2, 4, 8, 12, 0, 0, 0, 0, 0, 2, 4, 8, 12, 0, ++ 0, 0, 6, 8, 12, 0, 0, 0, 0, 0, 0, 6, 8, 12, 0, 0, 0, 0, ++ 2, 6, 8, 12, 0, 0, 0, 0, 0, 2, 6, 8, 12, 0, 0, 0, 4, 6, ++ 8, 12, 0, 0, 0, 0, 0, 4, 6, 8, 12, 0, 0, 0, 2, 4, 6, 8, ++ 12, 0, 0, 0, 0, 2, 4, 6, 8, 12, 0, 0, 10, 12, 0, 0, 0, 0, ++ 0, 0, 0, 10, 12, 0, 0, 0, 0, 0, 2, 10, 12, 0, 0, 0, 0, 0, ++ 0, 2, 10, 12, 0, 0, 0, 0, 4, 10, 12, 0, 0, 0, 0, 0, 0, 4, ++ 10, 12, 0, 0, 0, 0, 2, 4, 10, 12, 0, 0, 0, 0, 0, 2, 4, 10, ++ 12, 0, 0, 0, 6, 10, 12, 0, 0, 0, 0, 0, 0, 6, 10, 12, 0, 0, ++ 0, 0, 2, 6, 10, 12, 0, 0, 0, 0, 0, 2, 6, 10, 12, 0, 0, 0, ++ 4, 6, 10, 12, 0, 0, 0, 0, 0, 4, 6, 10, 12, 0, 0, 0, 2, 4, ++ 6, 10, 12, 0, 0, 0, 0, 2, 4, 6, 10, 12, 0, 0, 8, 10, 12, 0, ++ 0, 0, 0, 0, 0, 8, 10, 12, 0, 0, 0, 0, 2, 8, 10, 12, 0, 0, ++ 0, 0, 0, 2, 8, 10, 12, 0, 0, 0, 4, 8, 10, 12, 0, 0, 0, 0, ++ 0, 4, 8, 10, 12, 0, 0, 0, 2, 4, 8, 10, 12, 0, 0, 0, 0, 2, ++ 4, 8, 10, 12, 0, 0, 6, 8, 10, 12, 0, 0, 0, 0, 0, 6, 8, 10, ++ 12, 0, 0, 0, 2, 6, 8, 10, 12, 0, 0, 0, 0, 2, 6, 8, 10, 12, ++ 0, 0, 4, 6, 8, 10, 12, 0, 0, 0, 0, 4, 6, 8, 10, 12, 0, 0, ++ 2, 4, 6, 8, 10, 12, 0, 0, 0, 2, 4, 6, 8, 10, 12, 0, 14, 0, ++ 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 2, 14, 0, 0, ++ 0, 0, 0, 0, 0, 2, 14, 0, 0, 0, 0, 0, 4, 14, 0, 0, 0, 0, ++ 0, 0, 0, 4, 14, 0, 0, 0, 0, 0, 2, 4, 14, 0, 0, 0, 0, 0, ++ 0, 2, 4, 14, 0, 0, 0, 0, 6, 14, 0, 0, 0, 0, 0, 0, 0, 6, ++ 14, 0, 0, 0, 0, 0, 2, 6, 14, 0, 0, 0, 0, 0, 0, 2, 6, 14, ++ 0, 0, 0, 0, 4, 6, 14, 0, 0, 0, 0, 0, 0, 4, 6, 14, 0, 0, ++ 0, 0, 2, 4, 6, 14, 0, 0, 0, 0, 0, 2, 4, 6, 14, 0, 0, 0, ++ 8, 14, 0, 0, 0, 0, 0, 0, 0, 8, 14, 0, 0, 0, 0, 0, 2, 8, ++ 14, 0, 0, 0, 0, 0, 0, 2, 8, 14, 0, 0, 0, 0, 4, 8, 14, 0, ++ 0, 0, 0, 0, 0, 4, 8, 14, 0, 0, 0, 0, 2, 4, 8, 14, 0, 0, ++ 0, 0, 0, 2, 4, 8, 14, 0, 0, 0, 6, 8, 14, 0, 0, 0, 0, 0, ++ 0, 6, 8, 14, 0, 0, 0, 0, 2, 6, 8, 14, 0, 0, 0, 0, 0, 2, ++ 6, 8, 14, 0, 0, 0, 4, 6, 8, 14, 0, 0, 0, 0, 0, 4, 6, 8, ++ 14, 0, 0, 0, 2, 4, 6, 8, 14, 0, 0, 0, 0, 2, 4, 6, 8, 14, ++ 0, 0, 10, 14, 0, 0, 0, 0, 0, 0, 0, 10, 14, 0, 0, 0, 0, 0, ++ 2, 10, 14, 0, 0, 0, 0, 0, 0, 2, 10, 14, 0, 0, 0, 0, 4, 10, ++ 14, 0, 0, 0, 0, 0, 0, 4, 10, 14, 0, 0, 0, 0, 2, 4, 10, 14, ++ 0, 0, 0, 0, 0, 2, 4, 10, 14, 0, 0, 0, 6, 10, 14, 0, 0, 0, ++ 0, 0, 0, 6, 10, 14, 0, 0, 0, 0, 2, 6, 10, 14, 0, 0, 0, 0, ++ 0, 2, 6, 10, 14, 0, 0, 0, 4, 6, 10, 14, 0, 0, 0, 0, 0, 4, ++ 6, 10, 14, 0, 0, 0, 2, 4, 6, 10, 14, 0, 0, 0, 0, 2, 4, 6, ++ 10, 14, 0, 0, 8, 10, 14, 0, 0, 0, 0, 0, 0, 8, 10, 14, 0, 0, ++ 0, 0, 2, 8, 10, 14, 0, 0, 0, 0, 0, 2, 8, 10, 14, 0, 0, 0, ++ 4, 8, 10, 14, 0, 0, 0, 0, 0, 4, 8, 10, 14, 0, 0, 0, 2, 4, ++ 8, 10, 14, 0, 0, 0, 0, 2, 4, 8, 10, 14, 0, 0, 6, 8, 10, 14, ++ 0, 0, 0, 0, 0, 6, 8, 10, 14, 0, 0, 0, 2, 6, 8, 10, 14, 0, ++ 0, 0, 0, 2, 6, 8, 10, 14, 0, 0, 4, 6, 8, 10, 14, 0, 0, 0, ++ 0, 4, 6, 8, 10, 14, 0, 0, 2, 4, 6, 8, 10, 14, 0, 0, 0, 2, ++ 4, 6, 8, 10, 14, 0, 12, 14, 0, 0, 0, 0, 0, 0, 0, 12, 14, 0, ++ 0, 0, 0, 0, 2, 12, 14, 0, 0, 0, 0, 0, 0, 2, 12, 14, 0, 0, ++ 0, 0, 4, 12, 14, 0, 0, 0, 0, 0, 0, 4, 12, 14, 0, 0, 0, 0, ++ 2, 4, 12, 14, 0, 0, 0, 0, 0, 2, 4, 12, 14, 0, 0, 0, 6, 12, ++ 14, 0, 0, 0, 0, 0, 0, 6, 12, 14, 0, 0, 0, 0, 2, 6, 12, 14, ++ 0, 0, 0, 0, 0, 2, 6, 12, 14, 0, 0, 0, 4, 6, 12, 14, 0, 0, ++ 0, 0, 0, 4, 6, 12, 14, 0, 0, 0, 2, 4, 6, 12, 14, 0, 0, 0, ++ 0, 2, 4, 6, 12, 14, 0, 0, 8, 12, 14, 0, 0, 0, 0, 0, 0, 8, ++ 12, 14, 0, 0, 0, 0, 2, 8, 12, 14, 0, 0, 0, 0, 0, 2, 8, 12, ++ 14, 0, 0, 0, 4, 8, 12, 14, 0, 0, 0, 0, 0, 4, 8, 12, 14, 0, ++ 0, 0, 2, 4, 8, 12, 14, 0, 0, 0, 0, 2, 4, 8, 12, 14, 0, 0, ++ 6, 8, 12, 14, 0, 0, 0, 0, 0, 6, 8, 12, 14, 0, 0, 0, 2, 6, ++ 8, 12, 14, 0, 0, 0, 0, 2, 6, 8, 12, 14, 0, 0, 4, 6, 8, 12, ++ 14, 0, 0, 0, 0, 4, 6, 8, 12, 14, 0, 0, 2, 4, 6, 8, 12, 14, ++ 0, 0, 0, 2, 4, 6, 8, 12, 14, 0, 10, 12, 14, 0, 0, 0, 0, 0, ++ 0, 10, 12, 14, 0, 0, 0, 0, 2, 10, 12, 14, 0, 0, 0, 0, 0, 2, ++ 10, 12, 14, 0, 0, 0, 4, 10, 12, 14, 0, 0, 0, 0, 0, 4, 10, 12, ++ 14, 0, 0, 0, 2, 4, 10, 12, 14, 0, 0, 0, 0, 2, 4, 10, 12, 14, ++ 0, 0, 6, 10, 12, 14, 0, 0, 0, 0, 0, 6, 10, 12, 14, 0, 0, 0, ++ 2, 6, 10, 12, 14, 0, 0, 0, 0, 2, 6, 10, 12, 14, 0, 0, 4, 6, ++ 10, 12, 14, 0, 0, 0, 0, 4, 6, 10, 12, 14, 0, 0, 2, 4, 6, 10, ++ 12, 14, 0, 0, 0, 2, 4, 6, 10, 12, 14, 0, 8, 10, 12, 14, 0, 0, ++ 0, 0, 0, 8, 10, 12, 14, 0, 0, 0, 2, 8, 10, 12, 14, 0, 0, 0, ++ 0, 2, 8, 10, 12, 14, 0, 0, 4, 8, 10, 12, 14, 0, 0, 0, 0, 4, ++ 8, 10, 12, 14, 0, 0, 2, 4, 8, 10, 12, 14, 0, 0, 0, 2, 4, 8, ++ 10, 12, 14, 0, 6, 8, 10, 12, 14, 0, 0, 0, 0, 6, 8, 10, 12, 14, ++ 0, 0, 2, 6, 8, 10, 12, 14, 0, 0, 0, 2, 6, 8, 10, 12, 14, 0, ++ 4, 6, 8, 10, 12, 14, 0, 0, 0, 4, 6, 8, 10, 12, 14, 0, 2, 4, ++ 6, 8, 10, 12, 14, 0, 0, 2, 4, 6, 8, 10, 12, 14}; ++ ++ const Vec128 byte_idx = Load8Bytes(d8, table + mask_bits * 8); ++ const Vec128 pairs = ZipLower(byte_idx, byte_idx); ++ return BitCast(d, pairs + Set(du, 0x0100)); ++} ++ ++template ++HWY_INLINE Vec128 IdxFromBits(hwy::SizeTag<4> /*tag*/, ++ const uint64_t mask_bits) { + HWY_DASSERT(mask_bits < 16); + + // There are only 4 lanes, so we can afford to load the index vector directly. +@@ -3742,7 +4113,8 @@ HWY_INLINE Vec128 Idx32x4FromBits( + #if HWY_CAP_INTEGER64 || HWY_CAP_FLOAT64 + + template +-HWY_INLINE Vec128 Idx64x2FromBits(const uint64_t mask_bits) { ++HWY_INLINE Vec128 IdxFromBits(hwy::SizeTag<8> /*tag*/, ++ const uint64_t mask_bits) { + HWY_DASSERT(mask_bits < 4); + + // There are only 2 lanes, so we can afford to load the index vector directly. +@@ -3761,59 +4133,15 @@ HWY_INLINE Vec128 Idx64x2FromBits( + + // Helper function called by both Compress and CompressStore - avoids a + // redundant BitsFromMask in the latter. +- +-template +-HWY_API Vec128 Compress(Vec128 v, +- const uint64_t mask_bits) { +- const auto idx = detail::Idx32x4FromBits(mask_bits); +- return TableLookupBytes(v, idx); +-} +-template +-HWY_API Vec128 Compress(Vec128 v, +- const uint64_t mask_bits) { +- const auto idx = detail::Idx32x4FromBits(mask_bits); +- return TableLookupBytes(v, idx); +-} +- +-#if HWY_CAP_INTEGER64 +- +-template +-HWY_API Vec128 Compress(Vec128 v, +- const uint64_t mask_bits) { +- const auto idx = detail::Idx64x2FromBits(mask_bits); +- return TableLookupBytes(v, idx); +-} +-template +-HWY_API Vec128 Compress(Vec128 v, +- const uint64_t mask_bits) { +- const auto idx = detail::Idx64x2FromBits(mask_bits); +- return TableLookupBytes(v, idx); +-} +- +-#endif +- +-template +-HWY_API Vec128 Compress(Vec128 v, +- const uint64_t mask_bits) { +- const auto idx = detail::Idx32x4FromBits(mask_bits); +- const Simd df; +- const Simd di; +- return BitCast(df, TableLookupBytes(BitCast(di, v), idx)); +-} +- +-#if HWY_CAP_FLOAT64 +- +-template +-HWY_API Vec128 Compress(Vec128 v, +- const uint64_t mask_bits) { +- const auto idx = detail::Idx64x2FromBits(mask_bits); +- const Simd df; +- const Simd di; +- return BitCast(df, TableLookupBytes(BitCast(di, v), idx)); ++template ++HWY_API Vec128 Compress(Vec128 v, const uint64_t mask_bits) { ++ const auto idx = ++ detail::IdxFromBits(hwy::SizeTag(), mask_bits); ++ using D = Simd; ++ const RebindToSigned di; ++ return BitCast(D(), TableLookupBytes(BitCast(di, v), BitCast(di, idx))); + } + +-#endif +- + } // namespace detail + + template +@@ -3831,6 +4159,79 @@ HWY_API size_t CompressStore(Vec128 v0, ++ const Vec128 v1, ++ const Vec128 v2, ++ Full128 /*tag*/, ++ uint8_t* HWY_RESTRICT unaligned) { ++ const uint8x16x3_t triple = {v0.raw, v1.raw, v2.raw}; ++ vst3q_u8(unaligned, triple); ++} ++ ++// 64 bits ++HWY_API void StoreInterleaved3(const Vec128 v0, ++ const Vec128 v1, ++ const Vec128 v2, ++ Simd /*tag*/, ++ uint8_t* HWY_RESTRICT unaligned) { ++ const uint8x8x3_t triple = {v0.raw, v1.raw, v2.raw}; ++ vst3_u8(unaligned, triple); ++} ++ ++// <= 32 bits: avoid writing more than N bytes by copying to buffer ++template ++HWY_API void StoreInterleaved3(const Vec128 v0, ++ const Vec128 v1, ++ const Vec128 v2, ++ Simd /*tag*/, ++ uint8_t* HWY_RESTRICT unaligned) { ++ alignas(16) uint8_t buf[24]; ++ const uint8x8x3_t triple = {v0.raw, v1.raw, v2.raw}; ++ vst3_u8(buf, triple); ++ CopyBytes(buf, unaligned); ++} ++ ++// ------------------------------ StoreInterleaved4 ++ ++// 128 bits ++HWY_API void StoreInterleaved4(const Vec128 v0, ++ const Vec128 v1, ++ const Vec128 v2, ++ const Vec128 v3, ++ Full128 /*tag*/, ++ uint8_t* HWY_RESTRICT unaligned) { ++ const uint8x16x4_t quad = {v0.raw, v1.raw, v2.raw, v3.raw}; ++ vst4q_u8(unaligned, quad); ++} ++ ++// 64 bits ++HWY_API void StoreInterleaved4(const Vec128 v0, ++ const Vec128 v1, ++ const Vec128 v2, ++ const Vec128 v3, ++ Simd /*tag*/, ++ uint8_t* HWY_RESTRICT unaligned) { ++ const uint8x8x4_t quad = {v0.raw, v1.raw, v2.raw, v3.raw}; ++ vst4_u8(unaligned, quad); ++} ++ ++// <= 32 bits: avoid writing more than N bytes by copying to buffer ++template ++HWY_API void StoreInterleaved4(const Vec128 v0, ++ const Vec128 v1, ++ const Vec128 v2, ++ const Vec128 v3, ++ Simd /*tag*/, ++ uint8_t* HWY_RESTRICT unaligned) { ++ alignas(16) uint8_t buf[32]; ++ const uint8x8x4_t quad = {v0.raw, v1.raw, v2.raw, v3.raw}; ++ vst4_u8(buf, quad); ++ CopyBytes(buf, unaligned); ++} ++ + // ================================================== Operator wrapper + + // These apply to all x86_*-inl.h because there are no restrictions on V. +@@ -3885,7 +4286,8 @@ HWY_API auto Le(V a, V b) -> decltype(a + return a <= b; + } + +-#if !defined(__aarch64__) ++namespace detail { // for code folding ++#if HWY_ARCH_ARM_V7 + #undef vuzp1_s8 + #undef vuzp1_u8 + #undef vuzp1_s16 +@@ -3972,6 +4374,7 @@ HWY_API auto Le(V a, V b) -> decltype(a + #undef HWY_NEON_DEF_FUNCTION_UINT_8_16_32 + #undef HWY_NEON_DEF_FUNCTION_UINTS + #undef HWY_NEON_EVAL ++} // namespace detail + + // NOLINTNEXTLINE(google-readability-namespace-comments) + } // namespace HWY_NAMESPACE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/ops/arm_neon-inl.hE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/ops/arm_neon-inl.hE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/ops/rvv-inl.h.12 chromium-91.0.4472.77/third_party/highway/src/hwy/ops/rvv-inl.h +--- chromium-91.0.4472.77/third_party/highway/src/hwy/ops/rvv-inl.h.12 2021-06-02 10:56:05.230904367 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/ops/rvv-inl.h 2021-05-31 10:37:11.000000000 -0400 +@@ -39,6 +39,11 @@ using TFromV = TFromD>; + hwy::EnableIf>() && !IsFloat>()>* = nullptr + #define HWY_IF_FLOAT_V(V) hwy::EnableIf>()>* = nullptr + ++// kShift = log2 of multiplier: 0 for m1, 1 for m2, -2 for mf4 ++template ++using Full = Simd> (-kShift)) ++ : (HWY_LANES(T) << kShift)>; ++ + // ================================================== MACROS + + // Generate specializations and function definitions using X macros. Although +@@ -58,29 +63,30 @@ namespace detail { // for code folding + + // For given SEW, iterate over all LMUL. Precompute SEW/LMUL => MLEN because the + // preprocessor cannot easily do it. +-#define HWY_RVV_FOREACH_08(X_MACRO, BASE, CHAR, NAME, OP) \ +- X_MACRO(BASE, CHAR, 8, 1, 8, NAME, OP) \ +- X_MACRO(BASE, CHAR, 8, 2, 4, NAME, OP) \ +- X_MACRO(BASE, CHAR, 8, 4, 2, NAME, OP) \ +- X_MACRO(BASE, CHAR, 8, 8, 1, NAME, OP) +- +-#define HWY_RVV_FOREACH_16(X_MACRO, BASE, CHAR, NAME, OP) \ +- X_MACRO(BASE, CHAR, 16, 1, 16, NAME, OP) \ +- X_MACRO(BASE, CHAR, 16, 2, 8, NAME, OP) \ +- X_MACRO(BASE, CHAR, 16, 4, 4, NAME, OP) \ +- X_MACRO(BASE, CHAR, 16, 8, 2, NAME, OP) +- +-#define HWY_RVV_FOREACH_32(X_MACRO, BASE, CHAR, NAME, OP) \ +- X_MACRO(BASE, CHAR, 32, 1, 32, NAME, OP) \ +- X_MACRO(BASE, CHAR, 32, 2, 16, NAME, OP) \ +- X_MACRO(BASE, CHAR, 32, 4, 8, NAME, OP) \ +- X_MACRO(BASE, CHAR, 32, 8, 4, NAME, OP) +- +-#define HWY_RVV_FOREACH_64(X_MACRO, BASE, CHAR, NAME, OP) \ +- X_MACRO(BASE, CHAR, 64, 1, 64, NAME, OP) \ +- X_MACRO(BASE, CHAR, 64, 2, 32, NAME, OP) \ +- X_MACRO(BASE, CHAR, 64, 4, 16, NAME, OP) \ +- X_MACRO(BASE, CHAR, 64, 8, 8, NAME, OP) ++// TODO(janwas): GCC does not yet support fractional LMUL ++#define HWY_RVV_FOREACH_08(X_MACRO, BASE, CHAR, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 8, m1, /*kShift=*/0, /*MLEN=*/8, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 8, m2, /*kShift=*/1, /*MLEN=*/4, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 8, m4, /*kShift=*/2, /*MLEN=*/2, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 8, m8, /*kShift=*/3, /*MLEN=*/1, NAME, OP) ++ ++#define HWY_RVV_FOREACH_16(X_MACRO, BASE, CHAR, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 16, m1, /*kShift=*/0, /*MLEN=*/16, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 16, m2, /*kShift=*/1, /*MLEN=*/8, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 16, m4, /*kShift=*/2, /*MLEN=*/4, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 16, m8, /*kShift=*/3, /*MLEN=*/2, NAME, OP) ++ ++#define HWY_RVV_FOREACH_32(X_MACRO, BASE, CHAR, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 32, m1, /*kShift=*/0, /*MLEN=*/32, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 32, m2, /*kShift=*/1, /*MLEN=*/16, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 32, m4, /*kShift=*/2, /*MLEN=*/8, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 32, m8, /*kShift=*/3, /*MLEN=*/4, NAME, OP) ++ ++#define HWY_RVV_FOREACH_64(X_MACRO, BASE, CHAR, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 64, m1, /*kShift=*/0, /*MLEN=*/64, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 64, m2, /*kShift=*/1, /*MLEN=*/32, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 64, m4, /*kShift=*/2, /*MLEN=*/16, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 64, m8, /*kShift=*/3, /*MLEN=*/8, NAME, OP) + + // SEW for unsigned: + #define HWY_RVV_FOREACH_U08(X_MACRO, NAME, OP) \ +@@ -153,63 +159,61 @@ namespace detail { // for code folding + + // Assemble types for use in x-macros + #define HWY_RVV_T(BASE, SEW) BASE##SEW##_t +-#define HWY_RVV_D(CHAR, SEW, LMUL) D##CHAR##SEW##m##LMUL +-#define HWY_RVV_V(BASE, SEW, LMUL) v##BASE##SEW##m##LMUL##_t ++#define HWY_RVV_D(CHAR, SEW, LMUL) D##CHAR##SEW##LMUL ++#define HWY_RVV_V(BASE, SEW, LMUL) v##BASE##SEW##LMUL##_t + #define HWY_RVV_M(MLEN) vbool##MLEN##_t + + } // namespace detail + + // TODO(janwas): remove typedefs and only use HWY_RVV_V etc. directly + +-// TODO(janwas): do we want fractional LMUL? (can encode as negative) +-// Mixed-precision code can use LMUL 1..8 and that should be enough unless they +-// need many registers. +-#define HWY_SPECIALIZE(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ +- using HWY_RVV_D(CHAR, SEW, LMUL) = \ +- Simd; \ +- using V##CHAR##SEW##m##LMUL = HWY_RVV_V(BASE, SEW, LMUL); \ +- template <> \ +- struct DFromV_t { \ +- using Lane = HWY_RVV_T(BASE, SEW); \ +- using type = Simd; \ ++// Until we have full intrinsic support for fractional LMUL, mixed-precision ++// code can use LMUL 1..8 (adequate unless they need many registers). ++#define HWY_SPECIALIZE(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ using HWY_RVV_D(CHAR, SEW, LMUL) = Full; \ ++ using V##CHAR##SEW##LMUL = HWY_RVV_V(BASE, SEW, LMUL); \ ++ template <> \ ++ struct DFromV_t { \ ++ using Lane = HWY_RVV_T(BASE, SEW); \ ++ using type = Full; \ + }; + using Vf16m1 = vfloat16m1_t; + using Vf16m2 = vfloat16m2_t; + using Vf16m4 = vfloat16m4_t; + using Vf16m8 = vfloat16m8_t; +-using Df16m1 = Simd; +-using Df16m2 = Simd; +-using Df16m4 = Simd; +-using Df16m8 = Simd; ++using Df16m1 = Full; ++using Df16m2 = Full; ++using Df16m4 = Full; ++using Df16m8 = Full; + + HWY_RVV_FOREACH(HWY_SPECIALIZE, _, _) + #undef HWY_SPECIALIZE + + // vector = f(d), e.g. Zero +-#define HWY_RVV_RETV_ARGD(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ ++#define HWY_RVV_RETV_ARGD(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ + HWY_API HWY_RVV_V(BASE, SEW, LMUL) NAME(HWY_RVV_D(CHAR, SEW, LMUL) d) { \ + (void)Lanes(d); \ +- return v##OP##_##CHAR##SEW##m##LMUL(); \ ++ return v##OP##_##CHAR##SEW##LMUL(); \ + } + + // vector = f(vector), e.g. Not +-#define HWY_RVV_RETV_ARGV(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ ++#define HWY_RVV_RETV_ARGV(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ + HWY_API HWY_RVV_V(BASE, SEW, LMUL) NAME(HWY_RVV_V(BASE, SEW, LMUL) v) { \ +- return v##OP##_v_##CHAR##SEW##m##LMUL(v); \ ++ return v##OP##_v_##CHAR##SEW##LMUL(v); \ + } + + // vector = f(vector, scalar), e.g. detail::Add +-#define HWY_RVV_RETV_ARGVS(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ +- HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ +- NAME(HWY_RVV_V(BASE, SEW, LMUL) a, HWY_RVV_T(BASE, SEW) b) { \ +- return v##OP##_##CHAR##SEW##m##LMUL(a, b); \ ++#define HWY_RVV_RETV_ARGVS(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ ++ NAME(HWY_RVV_V(BASE, SEW, LMUL) a, HWY_RVV_T(BASE, SEW) b) { \ ++ return v##OP##_##CHAR##SEW##LMUL(a, b); \ + } + + // vector = f(vector, vector), e.g. Add +-#define HWY_RVV_RETV_ARGVV(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ ++#define HWY_RVV_RETV_ARGVV(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ + HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ + NAME(HWY_RVV_V(BASE, SEW, LMUL) a, HWY_RVV_V(BASE, SEW, LMUL) b) { \ +- return v##OP##_vv_##CHAR##SEW##m##LMUL(a, b); \ ++ return v##OP##_vv_##CHAR##SEW##LMUL(a, b); \ + } + + // ================================================== INIT +@@ -218,9 +222,9 @@ HWY_RVV_FOREACH(HWY_SPECIALIZE, _, _) + + // WARNING: we want to query VLMAX/sizeof(T), but this actually changes VL! + // vlenb is not exposed through intrinsics and vreadvl is not VLMAX. +-#define HWY_RVV_LANES(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ +- HWY_API size_t NAME(HWY_RVV_D(CHAR, SEW, LMUL) /* d */) { \ +- return v##OP##SEW##m##LMUL(); \ ++#define HWY_RVV_LANES(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ HWY_API size_t NAME(HWY_RVV_D(CHAR, SEW, LMUL) /* d */) { \ ++ return v##OP##SEW##LMUL(); \ + } + + HWY_RVV_FOREACH(HWY_RVV_LANES, Lanes, setvlmax_e) +@@ -233,19 +237,31 @@ HWY_RVV_FOREACH(HWY_RVV_RETV_ARGD, Zero, + template + using VFromD = decltype(Zero(D())); + ++// Partial ++template ++HWY_API VFromD> Zero(Simd /*tag*/) { ++ return Zero(Full()); ++} ++ + // ------------------------------ Set + // vector = f(d, scalar), e.g. Set +-#define HWY_RVV_SET(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ ++#define HWY_RVV_SET(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ + HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ + NAME(HWY_RVV_D(CHAR, SEW, LMUL) d, HWY_RVV_T(BASE, SEW) arg) { \ + (void)Lanes(d); \ +- return v##OP##_##CHAR##SEW##m##LMUL(arg); \ ++ return v##OP##_##CHAR##SEW##LMUL(arg); \ + } + + HWY_RVV_FOREACH_UI(HWY_RVV_SET, Set, mv_v_x) + HWY_RVV_FOREACH_F(HWY_RVV_SET, Set, fmv_v_f) + #undef HWY_RVV_SET + ++// Partial vectors ++template ++HWY_API VFromD> Set(Simd /*tag*/, T arg) { ++ return Set(Full(), arg); ++} ++ + // ------------------------------ Undefined + + // RVV vundefined is 'poisoned' such that even XORing a _variable_ initialized +@@ -265,7 +281,7 @@ HWY_API VFromD Undefined(D d) { + namespace detail { + + // u8: no change +-#define HWY_RVV_CAST_NOP(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ ++#define HWY_RVV_CAST_NOP(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ + HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ + BitCastToByte(HWY_RVV_V(BASE, SEW, LMUL) v) { \ + return v; \ +@@ -276,25 +292,25 @@ namespace detail { + } + + // Other integers +-#define HWY_RVV_CAST_UI(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ +- HWY_API vuint8m##LMUL##_t BitCastToByte(HWY_RVV_V(BASE, SEW, LMUL) v) { \ +- return v##OP##_v_##CHAR##SEW##m##LMUL##_u8m##LMUL(v); \ +- } \ +- HWY_API HWY_RVV_V(BASE, SEW, LMUL) BitCastFromByte( \ +- HWY_RVV_D(CHAR, SEW, LMUL) /* d */, vuint8m##LMUL##_t v) { \ +- return v##OP##_v_u8m##LMUL##_##CHAR##SEW##m##LMUL(v); \ ++#define HWY_RVV_CAST_UI(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ HWY_API vuint8##LMUL##_t BitCastToByte(HWY_RVV_V(BASE, SEW, LMUL) v) { \ ++ return v##OP##_v_##CHAR##SEW##LMUL##_u8##LMUL(v); \ ++ } \ ++ HWY_API HWY_RVV_V(BASE, SEW, LMUL) BitCastFromByte( \ ++ HWY_RVV_D(CHAR, SEW, LMUL) /* d */, vuint8##LMUL##_t v) { \ ++ return v##OP##_v_u8##LMUL##_##CHAR##SEW##LMUL(v); \ + } + + // Float: first cast to/from unsigned +-#define HWY_RVV_CAST_F(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ +- HWY_API vuint8m##LMUL##_t BitCastToByte(HWY_RVV_V(BASE, SEW, LMUL) v) { \ +- return v##OP##_v_u##SEW##m##LMUL##_u8m##LMUL( \ +- v##OP##_v_f##SEW##m##LMUL##_u##SEW##m##LMUL(v)); \ +- } \ +- HWY_API HWY_RVV_V(BASE, SEW, LMUL) BitCastFromByte( \ +- HWY_RVV_D(CHAR, SEW, LMUL) /* d */, vuint8m##LMUL##_t v) { \ +- return v##OP##_v_u##SEW##m##LMUL##_f##SEW##m##LMUL( \ +- v##OP##_v_u8m##LMUL##_u##SEW##m##LMUL(v)); \ ++#define HWY_RVV_CAST_F(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ HWY_API vuint8##LMUL##_t BitCastToByte(HWY_RVV_V(BASE, SEW, LMUL) v) { \ ++ return v##OP##_v_u##SEW##LMUL##_u8##LMUL( \ ++ v##OP##_v_f##SEW##LMUL##_u##SEW##LMUL(v)); \ ++ } \ ++ HWY_API HWY_RVV_V(BASE, SEW, LMUL) BitCastFromByte( \ ++ HWY_RVV_D(CHAR, SEW, LMUL) /* d */, vuint8##LMUL##_t v) { \ ++ return v##OP##_v_u##SEW##LMUL##_f##SEW##LMUL( \ ++ v##OP##_v_u8##LMUL##_u##SEW##LMUL(v)); \ + } + + HWY_RVV_FOREACH_U08(HWY_RVV_CAST_NOP, _, _) +@@ -315,6 +331,12 @@ HWY_API VFromD BitCast(D d, FromV v) + return detail::BitCastFromByte(d, detail::BitCastToByte(v)); + } + ++// Partial ++template ++HWY_API VFromD> BitCast(Simd /*tag*/, FromV v) { ++ return BitCast(Full(), v); ++} ++ + namespace detail { + + template >> +@@ -336,6 +358,12 @@ HWY_API VFromD Iota0(const D /*d*/) + return BitCastToUnsigned(Iota0(DU())); + } + ++// Partial ++template ++HWY_API VFromD> Iota0(Simd /*tag*/) { ++ return Iota0(Full()); ++} ++ + } // namespace detail + + // ================================================== LOGICAL +@@ -370,11 +398,11 @@ HWY_API V And(const V a, const V b) { + // ------------------------------ Or + + // Scalar argument plus mask. Used by VecFromMask. +-#define HWY_RVV_OR_MASK(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ ++#define HWY_RVV_OR_MASK(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ + HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ + NAME(HWY_RVV_V(BASE, SEW, LMUL) v, HWY_RVV_T(BASE, SEW) imm, \ + HWY_RVV_M(MLEN) mask, HWY_RVV_V(BASE, SEW, LMUL) maskedoff) { \ +- return v##OP##_##CHAR##SEW##m##LMUL##_m(mask, maskedoff, v, imm); \ ++ return v##OP##_##CHAR##SEW##LMUL##_m(mask, maskedoff, v, imm); \ + } + + namespace detail { +@@ -466,14 +494,14 @@ HWY_RVV_FOREACH_U16(HWY_RVV_RETV_ARGVV, + // ------------------------------ ShiftLeft[Same] + + // Intrinsics do not define .vi forms, so use .vx instead. +-#define HWY_RVV_SHIFT(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ +- template \ +- HWY_API HWY_RVV_V(BASE, SEW, LMUL) NAME(HWY_RVV_V(BASE, SEW, LMUL) v) { \ +- return v##OP##_vx_##CHAR##SEW##m##LMUL(v, kBits); \ +- } \ +- HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ +- NAME##Same(HWY_RVV_V(BASE, SEW, LMUL) v, int bits) { \ +- return v##OP##_vx_##CHAR##SEW##m##LMUL(v, static_cast(bits)); \ ++#define HWY_RVV_SHIFT(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ template \ ++ HWY_API HWY_RVV_V(BASE, SEW, LMUL) NAME(HWY_RVV_V(BASE, SEW, LMUL) v) { \ ++ return v##OP##_vx_##CHAR##SEW##LMUL(v, kBits); \ ++ } \ ++ HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ ++ NAME##Same(HWY_RVV_V(BASE, SEW, LMUL) v, int bits) { \ ++ return v##OP##_vx_##CHAR##SEW##LMUL(v, static_cast(bits)); \ + } + + HWY_RVV_FOREACH_UI(HWY_RVV_SHIFT, ShiftLeft, sll) +@@ -486,19 +514,18 @@ HWY_RVV_FOREACH_I(HWY_RVV_SHIFT, ShiftRi + #undef HWY_RVV_SHIFT + + // ------------------------------ Shl +-#define HWY_RVV_SHIFT_VV(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ ++#define HWY_RVV_SHIFT_VV(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ + HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ + NAME(HWY_RVV_V(BASE, SEW, LMUL) v, HWY_RVV_V(BASE, SEW, LMUL) bits) { \ +- return v##OP##_vv_##CHAR##SEW##m##LMUL(v, bits); \ ++ return v##OP##_vv_##CHAR##SEW##LMUL(v, bits); \ + } + + HWY_RVV_FOREACH_U(HWY_RVV_SHIFT_VV, Shl, sll) + +-#define HWY_RVV_SHIFT_II(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ ++#define HWY_RVV_SHIFT_II(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ + HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ + NAME(HWY_RVV_V(BASE, SEW, LMUL) v, HWY_RVV_V(BASE, SEW, LMUL) bits) { \ +- return v##OP##_vv_##CHAR##SEW##m##LMUL(v, \ +- detail::BitCastToUnsigned(bits)); \ ++ return v##OP##_vv_##CHAR##SEW##LMUL(v, detail::BitCastToUnsigned(bits)); \ + } + + HWY_RVV_FOREACH_I(HWY_RVV_SHIFT_II, Shl, sll) +@@ -569,11 +596,11 @@ HWY_API V ApproximateReciprocalSqrt(cons + + // ------------------------------ MulAdd + // Note: op is still named vv, not vvv. +-#define HWY_RVV_FMA(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ ++#define HWY_RVV_FMA(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ + HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ + NAME(HWY_RVV_V(BASE, SEW, LMUL) mul, HWY_RVV_V(BASE, SEW, LMUL) x, \ + HWY_RVV_V(BASE, SEW, LMUL) add) { \ +- return v##OP##_vv_##CHAR##SEW##m##LMUL(add, mul, x); \ ++ return v##OP##_vv_##CHAR##SEW##LMUL(add, mul, x); \ + } + + HWY_RVV_FOREACH_F(HWY_RVV_FMA, MulAdd, fmacc) +@@ -596,11 +623,11 @@ HWY_RVV_FOREACH_F(HWY_RVV_FMA, NegMulSub + // of all bits; SLEN 8 / LMUL 4 = half of all bits. + + // mask = f(vector, vector) +-#define HWY_RVV_RETM_ARGVV(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ ++#define HWY_RVV_RETM_ARGVV(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ + HWY_API HWY_RVV_M(MLEN) \ + NAME(HWY_RVV_V(BASE, SEW, LMUL) a, HWY_RVV_V(BASE, SEW, LMUL) b) { \ + (void)Lanes(DFromV()); \ +- return v##OP##_vv_##CHAR##SEW##m##LMUL##_b##MLEN(a, b); \ ++ return v##OP##_vv_##CHAR##SEW##LMUL##_b##MLEN(a, b); \ + } + + // ------------------------------ Eq +@@ -675,11 +702,11 @@ HWY_RVV_FOREACH_B(HWY_RVV_RETM_ARGMM, Xo + #undef HWY_RVV_RETM_ARGMM + + // ------------------------------ IfThenElse +-#define HWY_RVV_IF_THEN_ELSE(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ +- HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ +- NAME(HWY_RVV_M(MLEN) m, HWY_RVV_V(BASE, SEW, LMUL) yes, \ +- HWY_RVV_V(BASE, SEW, LMUL) no) { \ +- return v##OP##_vvm_##CHAR##SEW##m##LMUL(m, no, yes); \ ++#define HWY_RVV_IF_THEN_ELSE(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ ++ NAME(HWY_RVV_M(MLEN) m, HWY_RVV_V(BASE, SEW, LMUL) yes, \ ++ HWY_RVV_V(BASE, SEW, LMUL) no) { \ ++ return v##OP##_vvm_##CHAR##SEW##LMUL(m, no, yes); \ + } + + HWY_RVV_FOREACH(HWY_RVV_IF_THEN_ELSE, IfThenElse, merge) +@@ -710,7 +737,7 @@ template + using MFromD = decltype(MaskFromVec(Zero(D()))); + + template +-HWY_API MFromD RebindMask(const D d, const MFrom mask) { ++HWY_API MFromD RebindMask(const D /*d*/, const MFrom mask) { + // No need to check lane size/LMUL are the same: if not, casting MFrom to + // MFromD would fail. + return mask; +@@ -774,17 +801,17 @@ HWY_RVV_FOREACH_B(HWY_RVV_COUNT_TRUE, _, + + // ------------------------------ Load + +-#define HWY_RVV_LOAD(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ +- HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ +- NAME(HWY_RVV_D(CHAR, SEW, LMUL) d, \ +- const HWY_RVV_T(BASE, SEW) * HWY_RESTRICT p) { \ +- (void)Lanes(d); \ +- return v##OP##SEW##_v_##CHAR##SEW##m##LMUL(p); \ ++#define HWY_RVV_LOAD(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ ++ NAME(HWY_RVV_D(CHAR, SEW, LMUL) d, \ ++ const HWY_RVV_T(BASE, SEW) * HWY_RESTRICT p) { \ ++ (void)Lanes(d); \ ++ return v##OP##SEW##_v_##CHAR##SEW##LMUL(p); \ + } + HWY_RVV_FOREACH(HWY_RVV_LOAD, Load, le) + #undef HWY_RVV_LOAD + +-// Partial load ++// Partial + template + HWY_API VFromD> Load(Simd d, const T* HWY_RESTRICT p) { + return Load(d, p); +@@ -800,16 +827,22 @@ HWY_API VFromD LoadU(D d, const TFrom + + // ------------------------------ Store + +-#define HWY_RVV_RET_ARGVDP(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ +- HWY_API void NAME(HWY_RVV_V(BASE, SEW, LMUL) v, \ +- HWY_RVV_D(CHAR, SEW, LMUL) d, \ +- HWY_RVV_T(BASE, SEW) * HWY_RESTRICT p) { \ +- (void)Lanes(d); \ +- return v##OP##SEW##_v_##CHAR##SEW##m##LMUL(p, v); \ ++#define HWY_RVV_RET_ARGVDP(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ HWY_API void NAME(HWY_RVV_V(BASE, SEW, LMUL) v, \ ++ HWY_RVV_D(CHAR, SEW, LMUL) d, \ ++ HWY_RVV_T(BASE, SEW) * HWY_RESTRICT p) { \ ++ (void)Lanes(d); \ ++ return v##OP##SEW##_v_##CHAR##SEW##LMUL(p, v); \ + } + HWY_RVV_FOREACH(HWY_RVV_RET_ARGVDP, Store, se) + #undef HWY_RVV_RET_ARGVDP + ++// Partial ++template ++HWY_API void Store(VFromD> v, Simd d, T* HWY_RESTRICT p) { ++ return Store(v, Full(), p); ++} ++ + // ------------------------------ StoreU + + // RVV only requires lane alignment, not natural alignment of the entire vector. +@@ -825,19 +858,62 @@ HWY_API void Stream(const V v, D d, T* H + Store(v, d, aligned); + } + ++// ------------------------------ ScatterOffset ++ ++#define HWY_RVV_SCATTER(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ HWY_API void NAME(HWY_RVV_V(BASE, SEW, LMUL) v, \ ++ HWY_RVV_D(CHAR, SEW, LMUL) /* d */, \ ++ HWY_RVV_T(BASE, SEW) * HWY_RESTRICT base, \ ++ HWY_RVV_V(int, SEW, LMUL) offset) { \ ++ return v##OP##ei##SEW##_v_##CHAR##SEW##LMUL( \ ++ base, detail::BitCastToUnsigned(offset), v); \ ++ } ++HWY_RVV_FOREACH(HWY_RVV_SCATTER, ScatterOffset, sx) ++#undef HWY_RVV_SCATTER ++ ++// Partial ++template ++HWY_API void ScatterOffset(VFromD> v, Simd d, ++ T* HWY_RESTRICT base, ++ VFromD, N>> offset) { ++ return ScatterOffset(v, Full(), base, offset); ++} ++ ++// ------------------------------ ScatterIndex ++ ++template ++HWY_API void ScatterIndex(VFromD v, D d, TFromD* HWY_RESTRICT base, ++ const VFromD> index) { ++ return ScatterOffset(v, d, base, ShiftLeft<2>(index)); ++} ++ ++template ++HWY_API void ScatterIndex(VFromD v, D d, TFromD* HWY_RESTRICT base, ++ const VFromD> index) { ++ return ScatterOffset(v, d, base, ShiftLeft<3>(index)); ++} ++ + // ------------------------------ GatherOffset + +-#define HWY_RVV_GATHER(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ +- HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ +- NAME(HWY_RVV_D(CHAR, SEW, LMUL) /* d */, \ +- const HWY_RVV_T(BASE, SEW) * HWY_RESTRICT base, \ +- HWY_RVV_V(int, SEW, LMUL) offset) { \ +- return v##OP##ei##SEW##_v_##CHAR##SEW##m##LMUL( \ +- base, detail::BitCastToUnsigned(offset)); \ ++#define HWY_RVV_GATHER(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ ++ NAME(HWY_RVV_D(CHAR, SEW, LMUL) /* d */, \ ++ const HWY_RVV_T(BASE, SEW) * HWY_RESTRICT base, \ ++ HWY_RVV_V(int, SEW, LMUL) offset) { \ ++ return v##OP##ei##SEW##_v_##CHAR##SEW##LMUL( \ ++ base, detail::BitCastToUnsigned(offset)); \ + } + HWY_RVV_FOREACH(HWY_RVV_GATHER, GatherOffset, lx) + #undef HWY_RVV_GATHER + ++// Partial ++template ++HWY_API VFromD> GatherOffset(Simd d, ++ const T* HWY_RESTRICT base, ++ VFromD, N>> offset) { ++ return GatherOffset(Full(), base, offset); ++} ++ + // ------------------------------ GatherIndex + + template +@@ -852,37 +928,101 @@ HWY_API VFromD GatherIndex(D d, const + return GatherOffset(d, base, ShiftLeft<3>(index)); + } + +-// ================================================== CONVERT ++// ------------------------------ StoreInterleaved3 + +-// ------------------------------ PromoteTo U ++#define HWY_RVV_STORE3(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ HWY_API void NAME( \ ++ HWY_RVV_V(BASE, SEW, LMUL) a, HWY_RVV_V(BASE, SEW, LMUL) b, \ ++ HWY_RVV_V(BASE, SEW, LMUL) c, HWY_RVV_D(CHAR, SEW, LMUL) /* d */, \ ++ HWY_RVV_T(BASE, SEW) * HWY_RESTRICT unaligned) { \ ++ const v##BASE##SEW##LMUL##x3_t triple = \ ++ vcreate_##CHAR##SEW##LMUL##x3(a, b, c); \ ++ return v##OP##e8_v_##CHAR##SEW##LMUL##x3(unaligned, triple); \ ++ } ++// Segments are limited to 8 registers, so we can only go up to LMUL=2. ++HWY_RVV_STORE3(uint, u, 8, m1, /*kShift=*/0, 8, StoreInterleaved3, sseg3) ++HWY_RVV_STORE3(uint, u, 8, m2, /*kShift=*/1, 4, StoreInterleaved3, sseg3) + +-HWY_API Vu16m2 PromoteTo(Du16m2 /* d */, Vu8m1 v) { return vzext_vf2_u16m2(v); } +-HWY_API Vu16m4 PromoteTo(Du16m4 /* d */, Vu8m2 v) { return vzext_vf2_u16m4(v); } +-HWY_API Vu16m8 PromoteTo(Du16m8 /* d */, Vu8m4 v) { return vzext_vf2_u16m8(v); } ++#undef HWY_RVV_STORE3 + +-HWY_API Vu32m4 PromoteTo(Du32m4 /* d */, Vu8m1 v) { return vzext_vf4_u32m4(v); } +-HWY_API Vu32m8 PromoteTo(Du32m8 /* d */, Vu8m2 v) { return vzext_vf4_u32m8(v); } ++// Partial ++template ++HWY_API void StoreInterleaved3(VFromD> v0, VFromD> v1, ++ VFromD> v2, Simd /*tag*/, ++ T* unaligned) { ++ return StoreInterleaved3(v0, v1, v2, Full(), unaligned); ++} ++ ++// ------------------------------ StoreInterleaved4 ++ ++#define HWY_RVV_STORE4(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ HWY_API void NAME( \ ++ HWY_RVV_V(BASE, SEW, LMUL) v0, HWY_RVV_V(BASE, SEW, LMUL) v1, \ ++ HWY_RVV_V(BASE, SEW, LMUL) v2, HWY_RVV_V(BASE, SEW, LMUL) v3, \ ++ HWY_RVV_D(CHAR, SEW, LMUL) /* d */, \ ++ HWY_RVV_T(BASE, SEW) * HWY_RESTRICT aligned) { \ ++ const v##BASE##SEW##LMUL##x4_t quad = \ ++ vcreate_##CHAR##SEW##LMUL##x4(v0, v1, v2, v3); \ ++ return v##OP##e8_v_##CHAR##SEW##LMUL##x4(aligned, quad); \ ++ } ++// Segments are limited to 8 registers, so we can only go up to LMUL=2. ++HWY_RVV_STORE4(uint, u, 8, m1, /*kShift=*/0, 8, StoreInterleaved4, sseg4) ++HWY_RVV_STORE4(uint, u, 8, m2, /*kShift=*/1, 4, StoreInterleaved4, sseg4) + +-HWY_API Vu32m2 PromoteTo(Du32m2 /* d */, const Vu16m1 v) { +- return vzext_vf2_u32m2(v); +-} +-HWY_API Vu32m4 PromoteTo(Du32m4 /* d */, const Vu16m2 v) { +- return vzext_vf2_u32m4(v); +-} +-HWY_API Vu32m8 PromoteTo(Du32m8 /* d */, const Vu16m4 v) { +- return vzext_vf2_u32m8(v); +-} ++#undef HWY_RVV_STORE4 + +-HWY_API Vu64m2 PromoteTo(Du64m2 /* d */, const Vu32m1 v) { +- return vzext_vf2_u64m2(v); +-} +-HWY_API Vu64m4 PromoteTo(Du64m4 /* d */, const Vu32m2 v) { +- return vzext_vf2_u64m4(v); +-} +-HWY_API Vu64m8 PromoteTo(Du64m8 /* d */, const Vu32m4 v) { +- return vzext_vf2_u64m8(v); ++// Partial ++template ++HWY_API void StoreInterleaved4(VFromD> v0, VFromD> v1, ++ VFromD> v2, VFromD> v3, ++ Simd /*tag*/, T* unaligned) { ++ return StoreInterleaved4(v0, v1, v2, v3, Full(), unaligned); + } + ++// ================================================== CONVERT ++ ++#define HWY_RVV_PROMOTE(OP, BASE, CHAR, BITS, BASE_IN, BITS_IN, LMUL, LMUL_IN) \ ++ HWY_API HWY_RVV_V(BASE, BITS, LMUL) \ ++ PromoteTo(HWY_RVV_D(CHAR, BITS, LMUL) /*d*/, \ ++ HWY_RVV_V(BASE_IN, BITS_IN, LMUL_IN) v) { \ ++ return OP##CHAR##BITS##LMUL(v); \ ++ } ++ ++// TODO(janwas): GCC does not yet support fractional LMUL ++#define HWY_RVV_PROMOTE_X2(OP, BASE, CHAR, BITS, BASE_IN, BITS_IN) \ ++ /*HWY_RVV_PROMOTE(OP, BASE, CHAR, BITS, BASE_IN, BITS_IN, m1, mf2)*/ \ ++ HWY_RVV_PROMOTE(OP, BASE, CHAR, BITS, BASE_IN, BITS_IN, m2, m1) \ ++ HWY_RVV_PROMOTE(OP, BASE, CHAR, BITS, BASE_IN, BITS_IN, m4, m2) \ ++ HWY_RVV_PROMOTE(OP, BASE, CHAR, BITS, BASE_IN, BITS_IN, m8, m4) ++ ++#define HWY_RVV_PROMOTE_X4(OP, BASE, CHAR, BITS, BASE_IN, BITS_IN) \ ++ /*HWY_RVV_PROMOTE(OP, BASE, CHAR, BITS, BASE_IN, BITS_IN, m1, mf4)*/ \ ++ /*HWY_RVV_PROMOTE(OP, BASE, CHAR, BITS, BASE_IN, BITS_IN, m2, mf2)*/ \ ++ HWY_RVV_PROMOTE(OP, BASE, CHAR, BITS, BASE_IN, BITS_IN, m4, m1) \ ++ HWY_RVV_PROMOTE(OP, BASE, CHAR, BITS, BASE_IN, BITS_IN, m8, m2) ++ ++// ------------------------------ PromoteTo ++ ++HWY_RVV_PROMOTE_X2(vzext_vf2_, uint, u, 16, uint, 8) ++HWY_RVV_PROMOTE_X2(vzext_vf2_, uint, u, 32, uint, 16) ++HWY_RVV_PROMOTE_X2(vzext_vf2_, uint, u, 64, uint, 32) ++HWY_RVV_PROMOTE_X4(vzext_vf4_, uint, u, 32, uint, 8) ++ ++HWY_RVV_PROMOTE_X2(vsext_vf2_, int, i, 16, int, 8) ++HWY_RVV_PROMOTE_X2(vsext_vf2_, int, i, 32, int, 16) ++HWY_RVV_PROMOTE_X2(vsext_vf2_, int, i, 64, int, 32) ++HWY_RVV_PROMOTE_X4(vsext_vf4_, int, i, 32, int, 8) ++ ++HWY_RVV_PROMOTE_X2(vfwcvt_f_f_v_, float, f, 32, float, 16) ++HWY_RVV_PROMOTE_X2(vfwcvt_f_f_v_, float, f, 64, float, 32) ++ ++// i32 to f64 ++HWY_RVV_PROMOTE_X2(vfwcvt_f_x_v_, float, f, 64, int, 32) ++ ++#undef HWY_RVV_PROMOTE_X4 ++#undef HWY_RVV_PROMOTE_X2 ++#undef HWY_RVV_PROMOTE ++ + template + HWY_API VFromD> PromoteTo(Simd d, + VFromD> v) { +@@ -901,67 +1041,6 @@ HWY_API VFromD> Promote + return BitCast(d, PromoteTo(Simd(), v)); + } + +-// ------------------------------ PromoteTo I +- +-HWY_API Vi16m2 PromoteTo(Di16m2 /* d */, Vi8m1 v) { return vsext_vf2_i16m2(v); } +-HWY_API Vi16m4 PromoteTo(Di16m4 /* d */, Vi8m2 v) { return vsext_vf2_i16m4(v); } +-HWY_API Vi16m8 PromoteTo(Di16m8 /* d */, Vi8m4 v) { return vsext_vf2_i16m8(v); } +- +-HWY_API Vi32m4 PromoteTo(Di32m4 /* d */, Vi8m1 v) { return vsext_vf4_i32m4(v); } +-HWY_API Vi32m8 PromoteTo(Di32m8 /* d */, Vi8m2 v) { return vsext_vf4_i32m8(v); } +- +-HWY_API Vi32m2 PromoteTo(Di32m2 /* d */, const Vi16m1 v) { +- return vsext_vf2_i32m2(v); +-} +-HWY_API Vi32m4 PromoteTo(Di32m4 /* d */, const Vi16m2 v) { +- return vsext_vf2_i32m4(v); +-} +-HWY_API Vi32m8 PromoteTo(Di32m8 /* d */, const Vi16m4 v) { +- return vsext_vf2_i32m8(v); +-} +- +-HWY_API Vi64m2 PromoteTo(Di64m2 /* d */, const Vi32m1 v) { +- return vsext_vf2_i64m2(v); +-} +-HWY_API Vi64m4 PromoteTo(Di64m4 /* d */, const Vi32m2 v) { +- return vsext_vf2_i64m4(v); +-} +-HWY_API Vi64m8 PromoteTo(Di64m8 /* d */, const Vi32m4 v) { +- return vsext_vf2_i64m8(v); +-} +- +-// ------------------------------ PromoteTo F +- +-HWY_API Vf32m2 PromoteTo(Df32m2 /* d */, const Vf16m1 v) { +- return vfwcvt_f_f_v_f32m2(v); +-} +-HWY_API Vf32m4 PromoteTo(Df32m4 /* d */, const Vf16m2 v) { +- return vfwcvt_f_f_v_f32m4(v); +-} +-HWY_API Vf32m8 PromoteTo(Df32m8 /* d */, const Vf16m4 v) { +- return vfwcvt_f_f_v_f32m8(v); +-} +- +-HWY_API Vf64m2 PromoteTo(Df64m2 /* d */, const Vf32m1 v) { +- return vfwcvt_f_f_v_f64m2(v); +-} +-HWY_API Vf64m4 PromoteTo(Df64m4 /* d */, const Vf32m2 v) { +- return vfwcvt_f_f_v_f64m4(v); +-} +-HWY_API Vf64m8 PromoteTo(Df64m8 /* d */, const Vf32m4 v) { +- return vfwcvt_f_f_v_f64m8(v); +-} +- +-HWY_API Vf64m2 PromoteTo(Df64m2 /* d */, const Vi32m1 v) { +- return vfwcvt_f_x_v_f64m2(v); +-} +-HWY_API Vf64m4 PromoteTo(Df64m4 /* d */, const Vi32m2 v) { +- return vfwcvt_f_x_v_f64m4(v); +-} +-HWY_API Vf64m8 PromoteTo(Df64m8 /* d */, const Vi32m4 v) { +- return vfwcvt_f_x_v_f64m8(v); +-} +- + // ------------------------------ DemoteTo U + + // First clamp negative numbers to zero to match x86 packus. +@@ -1062,19 +1141,19 @@ HWY_API Vi32m4 DemoteTo(Di32m4 /* d */, + + // ------------------------------ ConvertTo F + +-#define HWY_RVV_CONVERT(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ ++#define HWY_RVV_CONVERT(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ + HWY_API HWY_RVV_V(BASE, SEW, LMUL) ConvertTo( \ + HWY_RVV_D(CHAR, SEW, LMUL) /* d */, HWY_RVV_V(int, SEW, LMUL) v) { \ +- return vfcvt_f_x_v_f##SEW##m##LMUL(v); \ ++ return vfcvt_f_x_v_f##SEW##LMUL(v); \ + } \ + /* Truncates (rounds toward zero). */ \ + HWY_API HWY_RVV_V(int, SEW, LMUL) ConvertTo(HWY_RVV_D(i, SEW, LMUL) /* d */, \ + HWY_RVV_V(BASE, SEW, LMUL) v) { \ +- return vfcvt_rtz_x_f_v_i##SEW##m##LMUL(v); \ ++ return vfcvt_rtz_x_f_v_i##SEW##LMUL(v); \ + } \ + /* Uses default rounding mode. */ \ + HWY_API HWY_RVV_V(int, SEW, LMUL) NearestInt(HWY_RVV_V(BASE, SEW, LMUL) v) { \ +- return vfcvt_x_f_v_i##SEW##m##LMUL(v); \ ++ return vfcvt_x_f_v_i##SEW##LMUL(v); \ + } + + // API only requires f32 but we provide f64 for internal use (otherwise, it +@@ -1082,16 +1161,23 @@ HWY_API Vi32m4 DemoteTo(Di32m4 /* d */, + HWY_RVV_FOREACH_F(HWY_RVV_CONVERT, _, _) + #undef HWY_RVV_CONVERT + ++// Partial ++template ++HWY_API VFromD> ConvertTo(Simd /*tag*/, FromV v) { ++ return ConvertTo(Full(), v); ++} ++ + // ================================================== SWIZZLE + + // ------------------------------ Compress + +-#define HWY_RVV_COMPRESS(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ +- HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ +- NAME(HWY_RVV_V(BASE, SEW, LMUL) v, HWY_RVV_M(MLEN) mask) { \ +- return v##OP##_vm_##CHAR##SEW##m##LMUL(mask, v, v); \ ++#define HWY_RVV_COMPRESS(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ ++ NAME(HWY_RVV_V(BASE, SEW, LMUL) v, HWY_RVV_M(MLEN) mask) { \ ++ return v##OP##_vm_##CHAR##SEW##LMUL(mask, v, v); \ + } + ++HWY_RVV_FOREACH_UI16(HWY_RVV_COMPRESS, Compress, compress) + HWY_RVV_FOREACH_UI32(HWY_RVV_COMPRESS, Compress, compress) + HWY_RVV_FOREACH_UI64(HWY_RVV_COMPRESS, Compress, compress) + HWY_RVV_FOREACH_F(HWY_RVV_COMPRESS, Compress, compress) +@@ -1121,10 +1207,10 @@ HWY_API VFromD SetTableIndices(D d, + + // <32bit are not part of Highway API, but used in Broadcast. This limits VLMAX + // to 2048! We could instead use vrgatherei16. +-#define HWY_RVV_TABLE(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ ++#define HWY_RVV_TABLE(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ + HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ + NAME(HWY_RVV_V(BASE, SEW, LMUL) v, HWY_RVV_V(uint, SEW, LMUL) idx) { \ +- return v##OP##_vv_##CHAR##SEW##m##LMUL(v, idx); \ ++ return v##OP##_vv_##CHAR##SEW##LMUL(v, idx); \ + } + + HWY_RVV_FOREACH(HWY_RVV_TABLE, TableLookupLanes, rgather) +@@ -1216,7 +1302,6 @@ HWY_API V OffsetsOf128BitBlocks(const D + using T = MakeUnsigned>; + return detail::And(iota0, static_cast(~(LanesPerBlock(d) - 1))); + } +- + } // namespace detail + + template +@@ -1244,9 +1329,9 @@ HWY_API V Broadcast(const V v) { + + // ------------------------------ GetLane + +-#define HWY_RVV_GET_LANE(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ +- HWY_API HWY_RVV_T(BASE, SEW) NAME(HWY_RVV_V(BASE, SEW, LMUL) v) { \ +- return v##OP##_s_##CHAR##SEW##m##LMUL##_##CHAR##SEW(v); \ ++#define HWY_RVV_GET_LANE(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ HWY_API HWY_RVV_T(BASE, SEW) NAME(HWY_RVV_V(BASE, SEW, LMUL) v) { \ ++ return v##OP##_s_##CHAR##SEW##LMUL##_##CHAR##SEW(v); \ + } + + HWY_RVV_FOREACH_UI(HWY_RVV_GET_LANE, GetLane, mv_x) +@@ -1255,11 +1340,12 @@ HWY_RVV_FOREACH_F(HWY_RVV_GET_LANE, GetL + + // ------------------------------ ShiftLeftLanes + +-// vector = f(vector, size_t) +-#define HWY_RVV_SLIDE(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ +- HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ +- NAME(HWY_RVV_V(BASE, SEW, LMUL) v, size_t lanes) { \ +- return v##OP##_vx_##CHAR##SEW##m##LMUL(v, v, lanes); \ ++// vector = f(vector, vector, size_t) ++#define HWY_RVV_SLIDE(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ ++ NAME(HWY_RVV_V(BASE, SEW, LMUL) dst, HWY_RVV_V(BASE, SEW, LMUL) src, \ ++ size_t lanes) { \ ++ return v##OP##_vx_##CHAR##SEW##LMUL(dst, src, lanes); \ + } + + namespace detail { +@@ -1270,7 +1356,7 @@ template + HWY_API V ShiftLeftLanes(const V v) { + using D = DFromV; + const RebindToSigned di; +- const auto shifted = detail::SlideUp(v, kLanes); ++ const auto shifted = detail::SlideUp(v, v, kLanes); + // Match x86 semantics by zeroing lower lanes in 128-bit blocks + constexpr size_t kLanesPerBlock = detail::LanesPerBlock(di); + const auto idx_mod = detail::And(detail::Iota0(di), kLanesPerBlock - 1); +@@ -1300,7 +1386,7 @@ template + HWY_API V ShiftRightLanes(const V v) { + using D = DFromV; + const RebindToSigned di; +- const auto shifted = detail::SlideDown(v, kLanes); ++ const auto shifted = detail::SlideDown(v, v, kLanes); + // Match x86 semantics by zeroing upper lanes in 128-bit blocks + constexpr size_t kLanesPerBlock = detail::LanesPerBlock(di); + const auto idx_mod = detail::And(detail::Iota0(di), kLanesPerBlock - 1); +@@ -1342,7 +1428,7 @@ HWY_API V ConcatUpperLower(const V hi, c + template + HWY_API V ConcatLowerLower(const V hi, const V lo) { + // Move lower half into upper +- const auto hi_up = detail::SlideUp(hi, Lanes(DFromV()) / 2); ++ const auto hi_up = detail::SlideUp(hi, hi, Lanes(DFromV()) / 2); + return ConcatUpperLower(hi_up, lo); + } + +@@ -1351,7 +1437,7 @@ HWY_API V ConcatLowerLower(const V hi, c + template + HWY_API V ConcatUpperUpper(const V hi, const V lo) { + // Move upper half into lower +- const auto lo_down = detail::SlideDown(lo, Lanes(DFromV()) / 2); ++ const auto lo_down = detail::SlideDown(lo, lo, Lanes(DFromV()) / 2); + return ConcatUpperLower(hi, lo_down); + } + +@@ -1360,8 +1446,8 @@ HWY_API V ConcatUpperUpper(const V hi, c + template + HWY_API V ConcatLowerUpper(const V hi, const V lo) { + // Move half of both inputs to the other half +- const auto hi_up = detail::SlideUp(hi, Lanes(DFromV()) / 2); +- const auto lo_down = detail::SlideDown(lo, Lanes(DFromV()) / 2); ++ const auto hi_up = detail::SlideUp(hi, hi, Lanes(DFromV()) / 2); ++ const auto lo_down = detail::SlideDown(lo, lo, Lanes(DFromV()) / 2); + return ConcatUpperLower(hi_up, lo_down); + } + +@@ -1428,61 +1514,55 @@ HWY_API V Combine(const V a, const V b) + // ================================================== REDUCE + + // vector = f(vector, zero_m1) +-#define HWY_RVV_REDUCE(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ +- HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ +- NAME(HWY_RVV_V(BASE, SEW, LMUL) v, HWY_RVV_V(BASE, SEW, 1) v0) { \ +- vsetvlmax_e##SEW##m##LMUL(); \ +- return Set(HWY_RVV_D(CHAR, SEW, LMUL)(), \ +- GetLane(v##OP##_vs_##CHAR##SEW##m##LMUL##_##CHAR##SEW##m1( \ +- v0, v, v0))); \ ++#define HWY_RVV_REDUCE(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ ++ NAME(HWY_RVV_V(BASE, SEW, LMUL) v, HWY_RVV_V(BASE, SEW, m1) v0) { \ ++ vsetvlmax_e##SEW##LMUL(); \ ++ return Set( \ ++ HWY_RVV_D(CHAR, SEW, LMUL)(), \ ++ GetLane(v##OP##_vs_##CHAR##SEW##LMUL##_##CHAR##SEW##m1(v0, v, v0))); \ + } + + // ------------------------------ SumOfLanes + + namespace detail { +- + HWY_RVV_FOREACH_UI(HWY_RVV_REDUCE, RedSum, redsum) + HWY_RVV_FOREACH_F(HWY_RVV_REDUCE, RedSum, fredsum) +- + } // namespace detail + + template + HWY_API V SumOfLanes(const V v) { + using T = TFromV; +- const auto v0 = Zero(Simd()); // always m1 ++ const auto v0 = Zero(Full()); // always m1 + return detail::RedSum(v, v0); + } + + // ------------------------------ MinOfLanes + namespace detail { +- + HWY_RVV_FOREACH_U(HWY_RVV_REDUCE, RedMin, redminu) + HWY_RVV_FOREACH_I(HWY_RVV_REDUCE, RedMin, redmin) + HWY_RVV_FOREACH_F(HWY_RVV_REDUCE, RedMin, fredmin) +- + } // namespace detail + + template + HWY_API V MinOfLanes(const V v) { + using T = TFromV; +- const Simd d1; // always m1 ++ const Full d1; // always m1 + const auto neutral = Set(d1, HighestValue()); + return detail::RedMin(v, neutral); + } + + // ------------------------------ MaxOfLanes + namespace detail { +- + HWY_RVV_FOREACH_U(HWY_RVV_REDUCE, RedMax, redmaxu) + HWY_RVV_FOREACH_I(HWY_RVV_REDUCE, RedMax, redmax) + HWY_RVV_FOREACH_F(HWY_RVV_REDUCE, RedMax, fredmax) +- + } // namespace detail + + template + HWY_API V MaxOfLanes(const V v) { + using T = TFromV; +- const Simd d1; // always m1 ++ const Full d1; // always m1 + const auto neutral = Set(d1, LowestValue()); + return detail::RedMax(v, neutral); + } +@@ -1507,7 +1587,7 @@ HWY_API VFromD LoadDup128(D d, const + #define HWY_RVV_STORE_MASK_BITS(MLEN, NAME, OP) \ + HWY_API size_t StoreMaskBits(HWY_RVV_M(MLEN) m, uint8_t* p) { \ + /* LMUL=1 is always enough */ \ +- Simd d8; \ ++ Full d8; \ + const size_t num_bytes = (Lanes(d8) + MLEN - 1) / MLEN; \ + /* TODO(janwas): how to convert vbool* to vuint?*/ \ + /*Store(m, d8, p);*/ \ +@@ -1518,6 +1598,22 @@ HWY_API VFromD LoadDup128(D d, const + HWY_RVV_FOREACH_B(HWY_RVV_STORE_MASK_BITS, _, _) + #undef HWY_RVV_STORE_MASK_BITS + ++// ------------------------------ FirstN (Iota0, Lt, RebindMask, SlideUp) ++ ++// Disallow for 8-bit because Iota is likely to overflow. ++template ++HWY_API MFromD FirstN(const D d, const size_t n) { ++ const RebindToSigned di; ++ return RebindMask(d, Lt(BitCast(di, detail::Iota0(d)), Set(di, n))); ++} ++ ++template ++HWY_API MFromD FirstN(const D d, const size_t n) { ++ const auto zero = Zero(d); ++ const auto one = Set(d, 1); ++ return Eq(detail::SlideUp(one, zero, n), one); ++} ++ + // ------------------------------ Neg + + template +@@ -1526,9 +1622,9 @@ HWY_API V Neg(const V v) { + } + + // vector = f(vector), but argument is repeated +-#define HWY_RVV_RETV_ARGV2(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ ++#define HWY_RVV_RETV_ARGV2(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ + HWY_API HWY_RVV_V(BASE, SEW, LMUL) NAME(HWY_RVV_V(BASE, SEW, LMUL) v) { \ +- return v##OP##_vv_##CHAR##SEW##m##LMUL(v, v); \ ++ return v##OP##_vv_##CHAR##SEW##LMUL(v, v); \ + } + + HWY_RVV_FOREACH_F(HWY_RVV_RETV_ARGV2, Neg, fsgnjn) +@@ -1565,7 +1661,6 @@ template + HWY_API auto UseInt(const V v) -> decltype(MaskFromVec(v)) { + return Lt(Abs(v), Set(DFromV(), MantissaEnd>())); + } +- + } // namespace detail + + template +@@ -1636,10 +1731,8 @@ HWY_API VFromD Iota(const D d, TFromD + // Using vwmul does not work for m8, so use mulh instead. Highway only provides + // MulHigh for 16-bit, so use a private wrapper. + namespace detail { +- + HWY_RVV_FOREACH_U32(HWY_RVV_RETV_ARGVV, MulHigh, mulhu) + HWY_RVV_FOREACH_I32(HWY_RVV_RETV_ARGVV, MulHigh, mulh) +- + } // namespace detail + + template +@@ -1649,7 +1742,7 @@ HWY_API VFromD> dw; +- return BitCast(dw, OddEven(detail::SlideUp(hi, 1), lo)); ++ return BitCast(dw, OddEven(detail::SlideUp(hi, hi, 1), lo)); + } + + // ================================================== END MACROS +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/ops/rvv-inl.hE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/ops/rvv-inl.hE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/ops/scalar-inl.h.12 chromium-91.0.4472.77/third_party/highway/src/hwy/ops/scalar-inl.h +--- chromium-91.0.4472.77/third_party/highway/src/hwy/ops/scalar-inl.h.12 2021-06-02 10:56:05.237904402 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/ops/scalar-inl.h 2021-05-31 10:37:11.000000000 -0400 +@@ -19,7 +19,6 @@ + #include + + #include // std::min +-#include + + #include "hwy/base.h" + #include "hwy/ops/shared-inl.h" +@@ -199,7 +198,7 @@ HWY_API Vec1 BroadcastSignBit(const V + template + HWY_API Mask1 RebindMask(Sisd /*tag*/, Mask1 m) { + static_assert(sizeof(TFrom) == sizeof(TTo), "Must have same size"); +- return Mask1(m.raw); ++ return Mask1{m.bits}; + } + + // v must be 0 or FF..FF. +@@ -224,6 +223,11 @@ Vec1 VecFromMask(Sisd /* tag */, c + return v; + } + ++template ++HWY_INLINE Mask1 FirstN(Sisd /*tag*/, size_t n) { ++ return Mask1::FromBool(n != 0); ++} ++ + // Returns mask ? yes : no. + template + HWY_INLINE Vec1 IfThenElse(const Mask1 mask, const Vec1 yes, +@@ -357,9 +361,9 @@ HWY_INLINE Vec1 operator>>(const Vec1 + + template + HWY_INLINE Vec1 operator+(Vec1 a, Vec1 b) { +- const uint64_t a64 = static_cast(a.raw); +- const uint64_t b64 = static_cast(b.raw); +- return Vec1((a64 + b64) & ~T(0)); ++ const uint64_t a64 = static_cast(a.raw); ++ const uint64_t b64 = static_cast(b.raw); ++ return Vec1(static_cast((a64 + b64) & static_cast(~T(0)))); + } + HWY_INLINE Vec1 operator+(const Vec1 a, const Vec1 b) { + return Vec1(a.raw + b.raw); +@@ -370,9 +374,9 @@ HWY_INLINE Vec1 operator+(const + + template + HWY_INLINE Vec1 operator-(Vec1 a, Vec1 b) { +- const uint64_t a64 = static_cast(a.raw); +- const uint64_t b64 = static_cast(b.raw); +- return Vec1((a64 - b64) & ~T(0)); ++ const uint64_t a64 = static_cast(a.raw); ++ const uint64_t b64 = static_cast(b.raw); ++ return Vec1(static_cast((a64 - b64) & static_cast(~T(0)))); + } + HWY_INLINE Vec1 operator-(const Vec1 a, const Vec1 b) { + return Vec1(a.raw - b.raw); +@@ -388,21 +392,25 @@ HWY_INLINE Vec1 operator-(const + // Unsigned + HWY_INLINE Vec1 SaturatedAdd(const Vec1 a, + const Vec1 b) { +- return Vec1(HWY_MIN(HWY_MAX(0, a.raw + b.raw), 255)); ++ return Vec1( ++ static_cast(HWY_MIN(HWY_MAX(0, a.raw + b.raw), 255))); + } + HWY_INLINE Vec1 SaturatedAdd(const Vec1 a, + const Vec1 b) { +- return Vec1(HWY_MIN(HWY_MAX(0, a.raw + b.raw), 65535)); ++ return Vec1( ++ static_cast(HWY_MIN(HWY_MAX(0, a.raw + b.raw), 65535))); + } + + // Signed + HWY_INLINE Vec1 SaturatedAdd(const Vec1 a, + const Vec1 b) { +- return Vec1(HWY_MIN(HWY_MAX(-128, a.raw + b.raw), 127)); ++ return Vec1( ++ static_cast(HWY_MIN(HWY_MAX(-128, a.raw + b.raw), 127))); + } + HWY_INLINE Vec1 SaturatedAdd(const Vec1 a, + const Vec1 b) { +- return Vec1(HWY_MIN(HWY_MAX(-32768, a.raw + b.raw), 32767)); ++ return Vec1( ++ static_cast(HWY_MIN(HWY_MAX(-32768, a.raw + b.raw), 32767))); + } + + // ------------------------------ Saturating subtraction +@@ -412,21 +420,25 @@ HWY_INLINE Vec1 SaturatedAdd(co + // Unsigned + HWY_INLINE Vec1 SaturatedSub(const Vec1 a, + const Vec1 b) { +- return Vec1(HWY_MIN(HWY_MAX(0, a.raw - b.raw), 255)); ++ return Vec1( ++ static_cast(HWY_MIN(HWY_MAX(0, a.raw - b.raw), 255))); + } + HWY_INLINE Vec1 SaturatedSub(const Vec1 a, + const Vec1 b) { +- return Vec1(HWY_MIN(HWY_MAX(0, a.raw - b.raw), 65535)); ++ return Vec1( ++ static_cast(HWY_MIN(HWY_MAX(0, a.raw - b.raw), 65535))); + } + + // Signed + HWY_INLINE Vec1 SaturatedSub(const Vec1 a, + const Vec1 b) { +- return Vec1(HWY_MIN(HWY_MAX(-128, a.raw - b.raw), 127)); ++ return Vec1( ++ static_cast(HWY_MIN(HWY_MAX(-128, a.raw - b.raw), 127))); + } + HWY_INLINE Vec1 SaturatedSub(const Vec1 a, + const Vec1 b) { +- return Vec1(HWY_MIN(HWY_MAX(-32768, a.raw - b.raw), 32767)); ++ return Vec1( ++ static_cast(HWY_MIN(HWY_MAX(-32768, a.raw - b.raw), 32767))); + } + + // ------------------------------ Average +@@ -435,11 +447,11 @@ HWY_INLINE Vec1 SaturatedSub(co + + HWY_INLINE Vec1 AverageRound(const Vec1 a, + const Vec1 b) { +- return Vec1((a.raw + b.raw + 1) / 2); ++ return Vec1(static_cast((a.raw + b.raw + 1) / 2)); + } + HWY_INLINE Vec1 AverageRound(const Vec1 a, + const Vec1 b) { +- return Vec1((a.raw + b.raw + 1) / 2); ++ return Vec1(static_cast((a.raw + b.raw + 1) / 2)); + } + + // ------------------------------ Absolute value +@@ -514,15 +526,15 @@ HWY_INLINE Vec1 operator/(const Vec1< + + // Returns the upper 16 bits of a * b in each lane. + HWY_INLINE Vec1 MulHigh(const Vec1 a, const Vec1 b) { +- return Vec1((a.raw * b.raw) >> 16); ++ return Vec1(static_cast((a.raw * b.raw) >> 16)); + } + HWY_INLINE Vec1 MulHigh(const Vec1 a, + const Vec1 b) { + // Cast to uint32_t first to prevent overflow. Otherwise the result of + // uint16_t * uint16_t is in "int" which may overflow. In practice the result + // is the same but this way it is also defined. +- return Vec1( +- (static_cast(a.raw) * static_cast(b.raw)) >> 16); ++ return Vec1(static_cast( ++ (static_cast(a.raw) * static_cast(b.raw)) >> 16)); + } + + // Multiplies even lanes (0, 2 ..) and returns the double-wide result. +@@ -617,6 +629,31 @@ HWY_INLINE Vec1 Round(const Vec1 v + return Vec1(static_cast(rounded)); + } + ++// Round-to-nearest even. ++HWY_INLINE Vec1 NearestInt(const Vec1 v) { ++ using T = float; ++ using TI = int32_t; ++ ++ const T abs = Abs(v).raw; ++ const bool signbit = std::signbit(v.raw); ++ ++ if (!(abs < MantissaEnd())) { // Huge or NaN ++ // Check if too large to cast or NaN ++ if (!(abs <= static_cast(LimitsMax()))) { ++ return Vec1(signbit ? LimitsMin() : LimitsMax()); ++ } ++ return Vec1(static_cast(v.raw)); ++ } ++ const T bias = v.raw < T(0.0) ? T(-0.5) : T(0.5); ++ const TI rounded = static_cast(v.raw + bias); ++ if (rounded == 0) return Vec1(0); ++ // Round to even ++ if ((rounded & 1) && std::abs(static_cast(rounded) - v.raw) == T(0.5)) { ++ return Vec1(rounded - (signbit ? -1 : 1)); ++ } ++ return Vec1(rounded); ++} ++ + template + HWY_INLINE Vec1 Trunc(const Vec1 v) { + using TI = MakeSigned; +@@ -641,7 +678,8 @@ V Ceiling(const V v) { + Bits bits; + CopyBytes(&v, &bits); + +- const int exponent = ((bits >> kMantissaBits) & kExponentMask) - kBias; ++ const int exponent = ++ static_cast(((bits >> kMantissaBits) & kExponentMask) - kBias); + // Already an integer. + if (exponent >= kMantissaBits) return v; + // |v| <= 1 => 0 or 1. +@@ -672,7 +710,8 @@ V Floor(const V v) { + Bits bits; + CopyBytes(&v, &bits); + +- const int exponent = ((bits >> kMantissaBits) & kExponentMask) - kBias; ++ const int exponent = ++ static_cast(((bits >> kMantissaBits) & kExponentMask) - kBias); + // Already an integer. + if (exponent >= kMantissaBits) return v; + // |v| <= 1 => -1 or 0. +@@ -772,6 +811,26 @@ HWY_INLINE void StoreU(const Vec1 v, + return Store(v, d, p); + } + ++// ------------------------------ StoreInterleaved3 ++ ++HWY_API void StoreInterleaved3(const Vec1 v0, const Vec1 v1, ++ const Vec1 v2, Sisd d, ++ uint8_t* HWY_RESTRICT unaligned) { ++ StoreU(v0, d, unaligned + 0); ++ StoreU(v1, d, unaligned + 1); ++ StoreU(v2, d, unaligned + 2); ++} ++ ++HWY_API void StoreInterleaved4(const Vec1 v0, const Vec1 v1, ++ const Vec1 v2, const Vec1 v3, ++ Sisd d, ++ uint8_t* HWY_RESTRICT unaligned) { ++ StoreU(v0, d, unaligned + 0); ++ StoreU(v1, d, unaligned + 1); ++ StoreU(v2, d, unaligned + 2); ++ StoreU(v3, d, unaligned + 3); ++} ++ + // ------------------------------ Stream + + template +@@ -779,12 +838,29 @@ HWY_INLINE void Stream(const Vec1 v, + return Store(v, d, aligned); + } + ++// ------------------------------ Scatter ++ ++template ++HWY_INLINE void ScatterOffset(Vec1 v, Sisd d, T* base, ++ const Vec1 offset) { ++ static_assert(sizeof(T) == sizeof(Offset), "Must match for portability"); ++ uint8_t* const base8 = reinterpret_cast(base) + offset.raw; ++ return Store(v, d, reinterpret_cast(base8)); ++} ++ ++template ++HWY_INLINE void ScatterIndex(Vec1 v, Sisd d, T* HWY_RESTRICT base, ++ const Vec1 index) { ++ static_assert(sizeof(T) == sizeof(Index), "Must match for portability"); ++ return Store(v, d, base + index.raw); ++} ++ + // ------------------------------ Gather + + template + HWY_INLINE Vec1 GatherOffset(Sisd d, const T* base, + const Vec1 offset) { +- static_assert(sizeof(T) == sizeof(Offset), "SVE requires same size base/ofs"); ++ static_assert(sizeof(T) == sizeof(Offset), "Must match for portability"); + const uintptr_t addr = reinterpret_cast(base) + offset.raw; + return Load(d, reinterpret_cast(addr)); + } +@@ -792,7 +868,7 @@ HWY_INLINE Vec1 GatherOffset(Sisd + template + HWY_INLINE Vec1 GatherIndex(Sisd d, const T* HWY_RESTRICT base, + const Vec1 index) { +- static_assert(sizeof(T) == sizeof(Index), "SVE requires same size base/idx"); ++ static_assert(sizeof(T) == sizeof(Index), "Must match for portability"); + return Load(d, base + index.raw); + } + +@@ -833,15 +909,20 @@ HWY_INLINE Vec1 DemoteTo(Sisd + + static HWY_INLINE Vec1 PromoteTo(Sisd /* tag */, + const Vec1 v) { ++#if HWY_NATIVE_FLOAT16 + uint16_t bits16; + CopyBytes<2>(&v.raw, &bits16); ++#else ++ const uint16_t bits16 = v.raw.bits; ++#endif + const uint32_t sign = bits16 >> 15; + const uint32_t biased_exp = (bits16 >> 10) & 0x1F; + const uint32_t mantissa = bits16 & 0x3FF; + + // Subnormal or zero + if (biased_exp == 0) { +- const float subnormal = (1.0f / 16384) * (mantissa * (1.0f / 1024)); ++ const float subnormal = ++ (1.0f / 16384) * (static_cast(mantissa) * (1.0f / 1024)); + return Vec1(sign ? -subnormal : subnormal); + } + +@@ -867,8 +948,12 @@ static HWY_INLINE Vec1 Demote + // Tiny or zero => zero. + Vec1 out; + if (exp < -24) { +- bits32 = 0; +- CopyBytes<2>(&bits32, &out); ++#if HWY_NATIVE_FLOAT16 ++ const uint16_t zero = 0; ++ CopyBytes<2>(&zero, &out.raw); ++#else ++ out.raw.bits = 0; ++#endif + return out; + } + +@@ -890,7 +975,12 @@ static HWY_INLINE Vec1 Demote + HWY_DASSERT(mantissa16 < 1024); + const uint32_t bits16 = (sign << 15) | (biased_exp16 << 10) | mantissa16; + HWY_DASSERT(bits16 < 0x10000); +- CopyBytes<2>(&bits16, &out); ++#if HWY_NATIVE_FLOAT16 ++ const uint16_t narrowed = static_cast(bits16); // big-endian safe ++ CopyBytes<2>(&narrowed, &out.raw); ++#else ++ out.raw.bits = static_cast(bits16); ++#endif + return out; + } + +@@ -919,18 +1009,6 @@ HWY_INLINE Vec1 U8FromU32(const + return DemoteTo(Sisd(), v); + } + +-// Approximation of round-to-nearest for numbers representable as int32_t. +-HWY_INLINE Vec1 NearestInt(const Vec1 v) { +- const float f = v.raw; +- if (std::isinf(f) || +- std::fabs(f) > static_cast(LimitsMax())) { +- return Vec1(std::signbit(f) ? LimitsMin() +- : LimitsMax()); +- } +- const float bias = f < 0.0f ? -0.5f : 0.5f; +- return Vec1(static_cast(f + bias)); +-} +- + // ================================================== SWIZZLE + + // Unsupported: Shift*Bytes, CombineShiftRightBytes, Interleave*, Shuffle*, +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/ops/scalar-inl.hE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/ops/scalar-inl.hE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/ops/set_macros-inl.h.12 chromium-91.0.4472.77/third_party/highway/src/hwy/ops/set_macros-inl.h +--- chromium-91.0.4472.77/third_party/highway/src/hwy/ops/set_macros-inl.h.12 2021-06-02 10:56:05.224904336 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/ops/set_macros-inl.h 2021-05-31 10:37:11.000000000 -0400 +@@ -31,11 +31,6 @@ + #undef HWY_ALIGN + #undef HWY_LANES + +-#undef HWY_GATHER_LANES +-#undef HWY_VARIABLE_SHIFT_LANES +-#undef HWY_COMPARE64_LANES +-#undef HWY_MINMAX64_LANES +- + #undef HWY_CAP_INTEGER64 + #undef HWY_CAP_FLOAT64 + #undef HWY_CAP_GE256 +@@ -53,11 +48,6 @@ + #define HWY_ALIGN alignas(16) + #define HWY_LANES(T) (16 / sizeof(T)) + +-#define HWY_GATHER_LANES(T) 1 +-#define HWY_VARIABLE_SHIFT_LANES(T) HWY_LANES(T) +-#define HWY_COMPARE64_LANES 2 +-#define HWY_MINMAX64_LANES 1 +- + #define HWY_CAP_INTEGER64 1 + #define HWY_CAP_FLOAT64 1 + #define HWY_CAP_GE256 0 +@@ -73,11 +63,6 @@ + #define HWY_ALIGN alignas(32) + #define HWY_LANES(T) (32 / sizeof(T)) + +-#define HWY_GATHER_LANES(T) HWY_LANES(T) +-#define HWY_VARIABLE_SHIFT_LANES(T) HWY_LANES(T) +-#define HWY_COMPARE64_LANES 4 +-#define HWY_MINMAX64_LANES 1 +- + #define HWY_CAP_INTEGER64 1 + #define HWY_CAP_FLOAT64 1 + #define HWY_CAP_GE256 1 +@@ -96,11 +81,6 @@ + #define HWY_ALIGN alignas(64) + #define HWY_LANES(T) (64 / sizeof(T)) + +-#define HWY_GATHER_LANES(T) HWY_LANES(T) +-#define HWY_VARIABLE_SHIFT_LANES(T) HWY_LANES(T) +-#define HWY_COMPARE64_LANES 8 +-#define HWY_MINMAX64_LANES 8 +- + #define HWY_CAP_INTEGER64 1 + #define HWY_CAP_FLOAT64 1 + #define HWY_CAP_GE256 1 +@@ -121,11 +101,6 @@ + #define HWY_ALIGN alignas(16) + #define HWY_LANES(T) (16 / sizeof(T)) + +-#define HWY_GATHER_LANES(T) 1 +-#define HWY_VARIABLE_SHIFT_LANES(T) HWY_LANES(T) +-#define HWY_COMPARE64_LANES 2 +-#define HWY_MINMAX64_LANES 2 +- + #define HWY_CAP_INTEGER64 1 + #define HWY_CAP_FLOAT64 1 + #define HWY_CAP_GE256 0 +@@ -142,19 +117,14 @@ + #define HWY_ALIGN alignas(16) + #define HWY_LANES(T) (16 / sizeof(T)) + +-#define HWY_GATHER_LANES(T) 1 +-#define HWY_VARIABLE_SHIFT_LANES(T) HWY_LANES(T) +-#define HWY_MINMAX64_LANES 2 +-#define HWY_COMPARE64_LANES 2 +- + #define HWY_CAP_INTEGER64 1 + #define HWY_CAP_GE256 0 + #define HWY_CAP_GE512 0 + +-#ifdef __arm__ +-#define HWY_CAP_FLOAT64 0 +-#else ++#if HWY_ARCH_ARM_A64 + #define HWY_CAP_FLOAT64 1 ++#else ++#define HWY_CAP_FLOAT64 0 + #endif + + #define HWY_NAMESPACE N_NEON +@@ -162,17 +132,34 @@ + // HWY_TARGET_STR remains undefined so HWY_ATTR is a no-op. + + //----------------------------------------------------------------------------- ++// SVE[2] ++#elif HWY_TARGET == HWY_SVE2 || HWY_TARGET == HWY_SVE ++ ++// SVE only requires lane alignment, not natural alignment of the entire vector. ++#define HWY_ALIGN alignas(8) ++// Upper bound, not the actual lane count! ++#define HWY_LANES(T) (256 / sizeof(T)) ++ ++#define HWY_CAP_INTEGER64 1 ++#define HWY_CAP_FLOAT64 1 ++#define HWY_CAP_GE256 0 ++#define HWY_CAP_GE512 0 ++ ++#if HWY_TARGET == HWY_SVE2 ++#define HWY_NAMESPACE N_SVE2 ++#else ++#define HWY_NAMESPACE N_SVE ++#endif ++ ++// HWY_TARGET_STR remains undefined - TODO(janwas): attribute for SVE? ++ ++//----------------------------------------------------------------------------- + // WASM + #elif HWY_TARGET == HWY_WASM + + #define HWY_ALIGN alignas(16) + #define HWY_LANES(T) (16 / sizeof(T)) + +-#define HWY_GATHER_LANES(T) 1 +-#define HWY_VARIABLE_SHIFT_LANES(T) HWY_LANES(T) +-#define HWY_COMPARE64_LANES 2 +-#define HWY_MINMAX64_LANES 2 +- + #define HWY_CAP_INTEGER64 0 + #define HWY_CAP_FLOAT64 0 + #define HWY_CAP_GE256 0 +@@ -194,11 +181,6 @@ + // mul/div by 8 for LMUL. Value matches kMaxVectorSize, see base.h. + #define HWY_LANES(T) (4096 / sizeof(T)) + +-#define HWY_GATHER_LANES(T) HWY_LANES(T) +-#define HWY_VARIABLE_SHIFT_LANES(T) HWY_LANES(T) +-// Cannot use HWY_LANES/sizeof here because these are used in an #if. +-#define HWY_COMPARE64_LANES 256 +-#define HWY_MINMAX64_LANES 256 + + #define HWY_CAP_INTEGER64 1 + #define HWY_CAP_FLOAT64 1 +@@ -215,13 +197,9 @@ + #elif HWY_TARGET == HWY_SCALAR + + #define HWY_ALIGN ++// For internal use only; use Lanes(d) instead. + #define HWY_LANES(T) 1 + +-#define HWY_GATHER_LANES(T) 1 +-#define HWY_VARIABLE_SHIFT_LANES(T) 1 +-#define HWY_COMPARE64_LANES 1 +-#define HWY_MINMAX64_LANES 1 +- + #define HWY_CAP_INTEGER64 1 + #define HWY_CAP_FLOAT64 1 + #define HWY_CAP_GE256 0 +@@ -265,3 +243,7 @@ + #else + #define HWY_ATTR + #endif ++ ++// DEPRECATED ++#undef HWY_GATHER_LANES ++#define HWY_GATHER_LANES(T) HWY_LANES(T) +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/ops/set_macros-inl.hE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/ops/set_macros-inl.hE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/ops/shared-inl.h.12 chromium-91.0.4472.77/third_party/highway/src/hwy/ops/shared-inl.h +--- chromium-91.0.4472.77/third_party/highway/src/hwy/ops/shared-inl.h.12 2021-06-02 10:56:05.235904392 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/ops/shared-inl.h 2021-05-31 10:37:11.000000000 -0400 +@@ -14,6 +14,8 @@ + + // Per-target definitions shared by ops/*.h and user code. + ++#include ++ + // Separate header because foreach_target.h re-enables its include guard. + #include "hwy/ops/set_macros-inl.h" + +@@ -106,7 +108,7 @@ HWY_INLINE HWY_MAYBE_UNUSED constexpr si + } + + // Targets with non-constexpr Lanes define this themselves. +-#if HWY_TARGET != HWY_RVV ++#if HWY_TARGET != HWY_RVV && HWY_TARGET != HWY_SVE2 && HWY_TARGET != HWY_SVE + + // (Potentially) non-constant actual size of the vector at runtime, subject to + // the limit imposed by the Simd. Useful for advancing loop counters. +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/ops/shared-inl.hE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/ops/shared-inl.hE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/ops/wasm_128-inl.h.12 chromium-91.0.4472.77/third_party/highway/src/hwy/ops/wasm_128-inl.h +--- chromium-91.0.4472.77/third_party/highway/src/hwy/ops/wasm_128-inl.h.12 2021-06-02 10:56:05.242904427 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/ops/wasm_128-inl.h 2021-05-31 10:37:11.000000000 -0400 +@@ -19,8 +19,6 @@ + #include + #include + +-#include +- + #include "hwy/base.h" + #include "hwy/ops/shared-inl.h" + +@@ -177,6 +175,16 @@ HWY_API Vec128 Undefined(Simd ++Vec128 Iota(const Simd d, const T2 first) { ++ HWY_ALIGN T lanes[16 / sizeof(T)]; ++ for (size_t i = 0; i < 16 / sizeof(T); ++i) { ++ lanes[i] = static_cast(first + static_cast(i)); ++ } ++ return Load(d, lanes); ++} ++ + // ================================================== ARITHMETIC + + // ------------------------------ Addition +@@ -273,24 +281,24 @@ HWY_API Vec128 operator-(const + template + HWY_API Vec128 SaturatedAdd(const Vec128 a, + const Vec128 b) { +- return Vec128{wasm_u8x16_add_saturate(a.raw, b.raw)}; ++ return Vec128{wasm_u8x16_add_sat(a.raw, b.raw)}; + } + template + HWY_API Vec128 SaturatedAdd(const Vec128 a, + const Vec128 b) { +- return Vec128{wasm_u16x8_add_saturate(a.raw, b.raw)}; ++ return Vec128{wasm_u16x8_add_sat(a.raw, b.raw)}; + } + + // Signed + template + HWY_API Vec128 SaturatedAdd(const Vec128 a, + const Vec128 b) { +- return Vec128{wasm_i8x16_add_saturate(a.raw, b.raw)}; ++ return Vec128{wasm_i8x16_add_sat(a.raw, b.raw)}; + } + template + HWY_API Vec128 SaturatedAdd(const Vec128 a, + const Vec128 b) { +- return Vec128{wasm_i16x8_add_saturate(a.raw, b.raw)}; ++ return Vec128{wasm_i16x8_add_sat(a.raw, b.raw)}; + } + + // ------------------------------ Saturating subtraction +@@ -301,24 +309,24 @@ HWY_API Vec128 SaturatedAdd( + template + HWY_API Vec128 SaturatedSub(const Vec128 a, + const Vec128 b) { +- return Vec128{wasm_u8x16_sub_saturate(a.raw, b.raw)}; ++ return Vec128{wasm_u8x16_sub_sat(a.raw, b.raw)}; + } + template + HWY_API Vec128 SaturatedSub(const Vec128 a, + const Vec128 b) { +- return Vec128{wasm_u16x8_sub_saturate(a.raw, b.raw)}; ++ return Vec128{wasm_u16x8_sub_sat(a.raw, b.raw)}; + } + + // Signed + template + HWY_API Vec128 SaturatedSub(const Vec128 a, + const Vec128 b) { +- return Vec128{wasm_i8x16_sub_saturate(a.raw, b.raw)}; ++ return Vec128{wasm_i8x16_sub_sat(a.raw, b.raw)}; + } + template + HWY_API Vec128 SaturatedSub(const Vec128 a, + const Vec128 b) { +- return Vec128{wasm_i16x8_sub_saturate(a.raw, b.raw)}; ++ return Vec128{wasm_i16x8_sub_sat(a.raw, b.raw)}; + } + + // ------------------------------ Average +@@ -352,6 +360,12 @@ template + HWY_API Vec128 Abs(const Vec128 v) { + return Vec128{wasm_i32x4_abs(v.raw)}; + } ++template ++HWY_API Vec128 Abs(const Vec128 v) { ++ // TODO(janwas): use wasm_i64x2_abs when available ++ const Vec128 mask = wasm_i64x2_shr(v.raw, 63); ++ return ((v ^ mask) - mask); ++} + + template + HWY_API Vec128 Abs(const Vec128 v) { +@@ -396,9 +410,38 @@ HWY_API Vec128 ShiftRight(co + return Vec128{wasm_i32x4_shr(v.raw, kBits)}; + } + ++// 8-bit ++template ++HWY_API Vec128 ShiftLeft(const Vec128 v) { ++ const Simd d8; ++ // Use raw instead of BitCast to support N=1. ++ const Vec128 shifted{ShiftLeft(Vec128>{v.raw}).raw}; ++ return kBits == 1 ++ ? (v + v) ++ : (shifted & Set(d8, static_cast((0xFF << kBits) & 0xFF))); ++} ++ ++template ++HWY_API Vec128 ShiftRight(const Vec128 v) { ++ const Simd d8; ++ // Use raw instead of BitCast to support N=1. ++ const Vec128 shifted{ ++ ShiftRight(Vec128{v.raw}).raw}; ++ return shifted & Set(d8, 0xFF >> kBits); ++} ++ ++template ++HWY_API Vec128 ShiftRight(const Vec128 v) { ++ const Simd di; ++ const Simd du; ++ const auto shifted = BitCast(di, ShiftRight(BitCast(du, v))); ++ const auto shifted_sign = BitCast(di, Set(du, 0x80 >> kBits)); ++ return (shifted ^ shifted_sign) - shifted_sign; ++} ++ + // ------------------------------ Shift lanes by same variable #bits + +-// Unsigned (no u8) ++// Unsigned + template + HWY_API Vec128 ShiftLeftSame(const Vec128 v, + const int bits) { +@@ -420,7 +463,7 @@ HWY_API Vec128 ShiftRightSa + return Vec128{wasm_u32x4_shr(v.raw, bits)}; + } + +-// Signed (no i8) ++// Signed + template + HWY_API Vec128 ShiftLeftSame(const Vec128 v, + const int bits) { +@@ -442,6 +485,35 @@ HWY_API Vec128 ShiftRightSam + return Vec128{wasm_i32x4_shr(v.raw, bits)}; + } + ++// 8-bit ++template ++HWY_API Vec128 ShiftLeftSame(const Vec128 v, const int bits) { ++ const Simd d8; ++ // Use raw instead of BitCast to support N=1. ++ const Vec128 shifted{ ++ ShiftLeftSame(Vec128>{v.raw}, bits).raw}; ++ return shifted & Set(d8, (0xFF << bits) & 0xFF); ++} ++ ++template ++HWY_API Vec128 ShiftRightSame(Vec128 v, ++ const int bits) { ++ const Simd d8; ++ // Use raw instead of BitCast to support N=1. ++ const Vec128 shifted{ ++ ShiftRightSame(Vec128{v.raw}, bits).raw}; ++ return shifted & Set(d8, 0xFF >> bits); ++} ++ ++template ++HWY_API Vec128 ShiftRightSame(Vec128 v, const int bits) { ++ const Simd di; ++ const Simd du; ++ const auto shifted = BitCast(di, ShiftRightSame(BitCast(du, v), bits)); ++ const auto shifted_sign = BitCast(di, Set(du, 0x80 >> bits)); ++ return (shifted ^ shifted_sign) - shifted_sign; ++} ++ + // ------------------------------ Minimum + + // Unsigned +@@ -607,29 +679,29 @@ template + HWY_API Vec128 MulHigh(const Vec128 a, + const Vec128 b) { + // TODO(eustas): replace, when implemented in WASM. +- const auto al = wasm_i32x4_widen_low_u16x8(a.raw); +- const auto ah = wasm_i32x4_widen_high_u16x8(a.raw); +- const auto bl = wasm_i32x4_widen_low_u16x8(b.raw); +- const auto bh = wasm_i32x4_widen_high_u16x8(b.raw); ++ const auto al = wasm_u32x4_extend_low_u16x8(a.raw); ++ const auto ah = wasm_u32x4_extend_high_u16x8(a.raw); ++ const auto bl = wasm_u32x4_extend_low_u16x8(b.raw); ++ const auto bh = wasm_u32x4_extend_high_u16x8(b.raw); + const auto l = wasm_i32x4_mul(al, bl); + const auto h = wasm_i32x4_mul(ah, bh); + // TODO(eustas): shift-right + narrow? + return Vec128{ +- wasm_v16x8_shuffle(l, h, 1, 3, 5, 7, 9, 11, 13, 15)}; ++ wasm_i16x8_shuffle(l, h, 1, 3, 5, 7, 9, 11, 13, 15)}; + } + template + HWY_API Vec128 MulHigh(const Vec128 a, + const Vec128 b) { + // TODO(eustas): replace, when implemented in WASM. +- const auto al = wasm_i32x4_widen_low_i16x8(a.raw); +- const auto ah = wasm_i32x4_widen_high_i16x8(a.raw); +- const auto bl = wasm_i32x4_widen_low_i16x8(b.raw); +- const auto bh = wasm_i32x4_widen_high_i16x8(b.raw); ++ const auto al = wasm_i32x4_extend_low_i16x8(a.raw); ++ const auto ah = wasm_i32x4_extend_high_i16x8(a.raw); ++ const auto bl = wasm_i32x4_extend_low_i16x8(b.raw); ++ const auto bh = wasm_i32x4_extend_high_i16x8(b.raw); + const auto l = wasm_i32x4_mul(al, bl); + const auto h = wasm_i32x4_mul(ah, bh); + // TODO(eustas): shift-right + narrow? + return Vec128{ +- wasm_v16x8_shuffle(l, h, 1, 3, 5, 7, 9, 11, 13, 15)}; ++ wasm_i16x8_shuffle(l, h, 1, 3, 5, 7, 9, 11, 13, 15)}; + } + + // Multiplies even lanes (0, 2 ..) and returns the double-width result. +@@ -765,53 +837,76 @@ HWY_API Vec128 ApproximateReci + // Toward nearest integer, ties to even + template + HWY_API Vec128 Round(const Vec128 v) { +- // TODO(eustas): is it f32x4.nearest? (not implemented yet) +- alignas(16) float input[4]; +- alignas(16) float output[4]; +- wasm_v128_store(input, v.raw); +- for (size_t i = 0; i < 4; ++i) { +- output[i] = std::nearbyint(input[i]); +- } +- return Vec128{wasm_v128_load(output)}; ++ // IEEE-754 roundToIntegralTiesToEven returns floating-point, but we do not ++ // yet have an instruction for that (f32x4.nearest is not implemented). We ++ // rely on rounding after addition with a large value such that no mantissa ++ // bits remain (assuming the current mode is nearest-even). We may need a ++ // compiler flag for precise floating-point to prevent "optimizing" this out. ++ const Simd df; ++ const auto max = Set(df, MantissaEnd()); ++ const auto large = CopySignToAbs(max, v); ++ const auto added = large + v; ++ const auto rounded = added - large; ++ ++ // Keep original if NaN or the magnitude is large (already an int). ++ return IfThenElse(Abs(v) < max, rounded, v); + } + ++namespace detail { ++ ++// Truncating to integer and converting back to float is correct except when the ++// input magnitude is large, in which case the input was already an integer ++// (because mantissa >> exponent is zero). ++template ++HWY_API Mask128 UseInt(const Vec128 v) { ++ return Abs(v) < Set(Simd(), MantissaEnd()); ++} ++ ++} // namespace detail ++ + // Toward zero, aka truncate + template + HWY_API Vec128 Trunc(const Vec128 v) { + // TODO(eustas): is it f32x4.trunc? (not implemented yet) +- alignas(16) float input[4]; +- alignas(16) float output[4]; +- wasm_v128_store(input, v.raw); +- for (size_t i = 0; i < 4; ++i) { +- output[i] = std::trunc(input[i]); +- } +- return Vec128{wasm_v128_load(output)}; ++ const Simd df; ++ const RebindToSigned di; ++ ++ const auto integer = ConvertTo(di, v); // round toward 0 ++ const auto int_f = ConvertTo(df, integer); ++ ++ return IfThenElse(detail::UseInt(v), CopySign(int_f, v), v); + } + + // Toward +infinity, aka ceiling + template +-HWY_API Vec128 Ceil(const Vec128 v) { ++HWY_INLINE Vec128 Ceil(const Vec128 v) { + // TODO(eustas): is it f32x4.ceil? (not implemented yet) +- alignas(16) float input[4]; +- alignas(16) float output[4]; +- wasm_v128_store(input, v.raw); +- for (size_t i = 0; i < 4; ++i) { +- output[i] = std::ceil(input[i]); +- } +- return Vec128{wasm_v128_load(output)}; ++ const Simd df; ++ const RebindToSigned di; ++ ++ const auto integer = ConvertTo(di, v); // round toward 0 ++ const auto int_f = ConvertTo(df, integer); ++ ++ // Truncating a positive non-integer ends up smaller; if so, add 1. ++ const auto neg1 = ConvertTo(df, VecFromMask(di, RebindMask(di, int_f < v))); ++ ++ return IfThenElse(detail::UseInt(v), int_f - neg1, v); + } + + // Toward -infinity, aka floor + template +-HWY_API Vec128 Floor(const Vec128 v) { ++HWY_INLINE Vec128 Floor(const Vec128 v) { + // TODO(eustas): is it f32x4.floor? (not implemented yet) +- alignas(16) float input[4]; +- alignas(16) float output[4]; +- wasm_v128_store(input, v.raw); +- for (size_t i = 0; i < 4; ++i) { +- output[i] = std::floor(input[i]); +- } +- return Vec128{wasm_v128_load(output)}; ++ const Simd df; ++ const RebindToSigned di; ++ ++ const auto integer = ConvertTo(di, v); // round toward 0 ++ const auto int_f = ConvertTo(df, integer); ++ ++ // Truncating a negative non-integer ends up larger; if so, subtract 1. ++ const auto neg1 = ConvertTo(df, VecFromMask(di, RebindMask(di, int_f > v))); ++ ++ return IfThenElse(detail::UseInt(v), int_f + neg1, v); + } + + // ================================================== COMPARE +@@ -902,12 +997,12 @@ HWY_API Mask128 operator>(co + + // Otherwise, the lower half decides. + const auto m_eq = a32 == b32; +- const auto lo_in_hi = wasm_v32x4_shuffle(m_gt, m_gt, 2, 2, 0, 0); ++ const auto lo_in_hi = wasm_i32x4_shuffle(m_gt, m_gt, 2, 2, 0, 0); + const auto lo_gt = And(m_eq, lo_in_hi); + + const auto gt = Or(lo_gt, m_gt); + // Copy result in upper 32 bits to lower 32 bits. +- return Mask128{wasm_v32x4_shuffle(gt, gt, 3, 3, 1, 1)}; ++ return Mask128{wasm_i32x4_shuffle(gt, gt, 3, 3, 1, 1)}; + } + + template +@@ -935,6 +1030,14 @@ HWY_API Mask128 operator>=(con + return Mask128{wasm_f32x4_ge(a.raw, b.raw)}; + } + ++// ------------------------------ FirstN (Iota, Lt) ++ ++template ++HWY_API Mask128 FirstN(const Simd d, size_t num) { ++ const RebindToSigned di; // Signed comparisons may be cheaper. ++ return RebindMask(d, Iota(di, 0) < Set(di, static_cast>(num))); ++} ++ + // ================================================== LOGICAL + + // ------------------------------ Not +@@ -1015,7 +1118,7 @@ HWY_API Vec128 BroadcastSignBit(co + } + template + HWY_API Vec128 BroadcastSignBit(const Vec128 v) { +- return VecFromMask(v < Zero(Simd())); ++ return VecFromMask(Simd(), v < Zero(Simd())); + } + + // ------------------------------ Mask +@@ -1278,26 +1381,73 @@ HWY_API void Stream(Vec128 v, Simd + wasm_v128_store(aligned, v.raw); + } + +-// ------------------------------ Gather ++// ------------------------------ Scatter (Store) ++ ++template ++HWY_API void ScatterOffset(Vec128 v, Simd d, T* HWY_RESTRICT base, ++ const Vec128 offset) { ++ static_assert(sizeof(T) == sizeof(Offset), "Must match for portability"); ++ ++ alignas(16) T lanes[N]; ++ Store(v, d, lanes); ++ ++ alignas(16) Offset offset_lanes[N]; ++ Store(offset, Simd(), offset_lanes); ++ ++ uint8_t* base_bytes = reinterpret_cast(base); ++ for (size_t i = 0; i < N; ++i) { ++ CopyBytes(&lanes[i], base_bytes + offset_lanes[i]); ++ } ++} ++ ++template ++HWY_API void ScatterIndex(Vec128 v, Simd d, T* HWY_RESTRICT base, ++ const Vec128 index) { ++ static_assert(sizeof(T) == sizeof(Index), "Must match for portability"); ++ ++ alignas(16) T lanes[N]; ++ Store(v, d, lanes); ++ ++ alignas(16) Index index_lanes[N]; ++ Store(index, Simd(), index_lanes); ++ ++ for (size_t i = 0; i < N; ++i) { ++ base[index_lanes[i]] = lanes[i]; ++ } ++} ++ ++// ------------------------------ Gather (Load/Store) + + template + HWY_API Vec128 GatherOffset(const Simd d, + const T* HWY_RESTRICT base, + const Vec128 offset) { +- static_assert(N == 1, "Wasm does not support full gather"); +- static_assert(sizeof(T) == sizeof(Offset), "T must match Offset"); +- const uintptr_t address = reinterpret_cast(base) + GetLane(offset); +- T val; +- CopyBytes(reinterpret_cast(address), &val); +- return Set(d, val); ++ static_assert(sizeof(T) == sizeof(Offset), "Must match for portability"); ++ ++ alignas(16) Offset offset_lanes[N]; ++ Store(offset, Simd(), offset_lanes); ++ ++ alignas(16) T lanes[N]; ++ const uint8_t* base_bytes = reinterpret_cast(base); ++ for (size_t i = 0; i < N; ++i) { ++ CopyBytes(base_bytes + offset_lanes[i], &lanes[i]); ++ } ++ return Load(d, lanes); + } + + template + HWY_API Vec128 GatherIndex(const Simd d, const T* HWY_RESTRICT base, + const Vec128 index) { +- static_assert(N == 1, "Wasm does not support full gather"); +- static_assert(sizeof(T) == sizeof(Index), "T must match Index"); +- return Set(d, base[GetLane(index)]); ++ static_assert(sizeof(T) == sizeof(Index), "Must match for portability"); ++ ++ alignas(16) Index index_lanes[N]; ++ Store(index, Simd(), index_lanes); ++ ++ alignas(16) T lanes[N]; ++ for (size_t i = 0; i < N; ++i) { ++ lanes[i] = base[index_lanes[i]]; ++ } ++ return Load(d, lanes); + } + + // ================================================== SWIZZLE +@@ -1346,12 +1496,12 @@ HWY_API Vec128 LowerHalf(Vec12 + template + HWY_API Vec128 UpperHalf(Vec128 v) { + // TODO(eustas): use swizzle? +- return Vec128{wasm_v32x4_shuffle(v.raw, v.raw, 2, 3, 2, 3)}; ++ return Vec128{wasm_i32x4_shuffle(v.raw, v.raw, 2, 3, 2, 3)}; + } + template <> + HWY_INLINE Vec128 UpperHalf(Vec128 v) { + // TODO(eustas): use swizzle? +- return Vec128{wasm_v32x4_shuffle(v.raw, v.raw, 2, 3, 2, 3)}; ++ return Vec128{wasm_i32x4_shuffle(v.raw, v.raw, 2, 3, 2, 3)}; + } + + // ------------------------------ Shift vector by constant #bytes +@@ -1366,64 +1516,64 @@ HWY_API Vec128 ShiftLeftBytes(const V + return v; + + case 1: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 16, 0, 1, 2, 3, 4, 5, 6, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 16, 0, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14)}; + + case 2: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 16, 16, 0, 1, 2, 3, 4, 5, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 16, 16, 0, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13)}; + + case 3: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 16, 16, 16, 0, 1, 2, 3, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 16, 16, 16, 0, 1, 2, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12)}; + + case 4: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 16, 16, 16, 16, 0, 1, 2, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 16, 16, 16, 16, 0, 1, 2, + 3, 4, 5, 6, 7, 8, 9, 10, 11)}; + + case 5: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 16, 16, 16, 16, 16, 0, 1, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 16, 16, 16, 16, 16, 0, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10)}; + + case 6: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 16, 16, 16, 16, 16, 16, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 16, 16, 16, 16, 16, 16, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)}; + + case 7: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 16, 16, 16, 16, 16, 16, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 16, 16, 16, 16, 16, 16, + 16, 0, 1, 2, 3, 4, 5, 6, 7, 8)}; + + case 8: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 16, 16, 16, 16, 16, 16, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 16, 16, 16, 16, 16, 16, + 16, 16, 0, 1, 2, 3, 4, 5, 6, 7)}; + + case 9: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 16, 16, 16, 16, 16, 16, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 0, 1, 2, 3, 4, 5, 6)}; + + case 10: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 16, 16, 16, 16, 16, 16, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 0, 1, 2, 3, 4, 5)}; + + case 11: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 16, 16, 16, 16, 16, 16, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 0, 1, 2, 3, 4)}; + + case 12: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 16, 16, 16, 16, 16, 16, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 0, 1, 2, 3)}; + + case 13: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 16, 16, 16, 16, 16, 16, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 0, 1, 2)}; + + case 14: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 16, 16, 16, 16, 16, 16, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 0, + 1)}; + + case 15: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 16, 16, 16, 16, 16, 16, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, + 0)}; + } +@@ -1447,69 +1597,69 @@ HWY_API Vec128 ShiftRightBytes(const + return v; + + case 1: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 1, 2, 3, 4, 5, 6, 7, 8, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 1, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16)}; + + case 2: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 2, 3, 4, 5, 6, 7, 8, 9, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 16)}; + + case 3: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 3, 4, 5, 6, 7, 8, 9, 10, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 16, 16)}; + + case 4: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 4, 5, 6, 7, 8, 9, 10, 11, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 16, 16, 16)}; + + case 5: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 5, 6, 7, 8, 9, 10, 11, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 16, 16, 16, 16)}; + + case 6: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 6, 7, 8, 9, 10, 11, 12, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 16, 16, 16, 16, 16)}; + + case 7: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 7, 8, 9, 10, 11, 12, 13, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 16, 16, 16, 16, 16, 16)}; + + case 8: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 8, 9, 10, 11, 12, 13, 14, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 16, 16, 16, 16, 16, 16, 16)}; + + case 9: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 9, 10, 11, 12, 13, 14, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 9, 10, 11, 12, 13, 14, + 15, 16, 16, 16, 16, 16, 16, 16, 16, + 16)}; + + case 10: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 10, 11, 12, 13, 14, 15, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 10, 11, 12, 13, 14, 15, + 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16)}; + + case 11: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 11, 12, 13, 14, 15, 16, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 11, 12, 13, 14, 15, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16)}; + + case 12: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 12, 13, 14, 15, 16, 16, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 12, 13, 14, 15, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16)}; + + case 13: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 13, 14, 15, 16, 16, 16, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 13, 14, 15, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16)}; + + case 14: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 14, 15, 16, 16, 16, 16, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 14, 15, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16)}; + + case 15: +- return Vec128{wasm_v8x16_shuffle(v.raw, zero, 15, 16, 16, 16, 16, 16, ++ return Vec128{wasm_i8x16_shuffle(v.raw, zero, 15, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16)}; + } +@@ -1535,72 +1685,72 @@ HWY_API Vec128 CombineShiftRightBytes + return lo; + + case 1: +- return Vec128{wasm_v8x16_shuffle(lo.raw, hi.raw, 1, 2, 3, 4, 5, 6, 7, ++ return Vec128{wasm_i8x16_shuffle(lo.raw, hi.raw, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16)}; + + case 2: +- return Vec128{wasm_v8x16_shuffle(lo.raw, hi.raw, 2, 3, 4, 5, 6, 7, 8, ++ return Vec128{wasm_i8x16_shuffle(lo.raw, hi.raw, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17)}; + + case 3: +- return Vec128{wasm_v8x16_shuffle(lo.raw, hi.raw, 3, 4, 5, 6, 7, 8, 9, ++ return Vec128{wasm_i8x16_shuffle(lo.raw, hi.raw, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18)}; + + case 4: +- return Vec128{wasm_v8x16_shuffle(lo.raw, hi.raw, 4, 5, 6, 7, 8, 9, 10, ++ return Vec128{wasm_i8x16_shuffle(lo.raw, hi.raw, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19)}; + + case 5: +- return Vec128{wasm_v8x16_shuffle(lo.raw, hi.raw, 5, 6, 7, 8, 9, 10, 11, ++ return Vec128{wasm_i8x16_shuffle(lo.raw, hi.raw, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20)}; + + case 6: +- return Vec128{wasm_v8x16_shuffle(lo.raw, hi.raw, 6, 7, 8, 9, 10, 11, ++ return Vec128{wasm_i8x16_shuffle(lo.raw, hi.raw, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21)}; + + case 7: +- return Vec128{wasm_v8x16_shuffle(lo.raw, hi.raw, 7, 8, 9, 10, 11, 12, ++ return Vec128{wasm_i8x16_shuffle(lo.raw, hi.raw, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22)}; + + case 8: +- return Vec128{wasm_v8x16_shuffle(lo.raw, hi.raw, 8, 9, 10, 11, 12, 13, ++ return Vec128{wasm_i8x16_shuffle(lo.raw, hi.raw, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23)}; + + case 9: +- return Vec128{wasm_v8x16_shuffle(lo.raw, hi.raw, 9, 10, 11, 12, 13, 14, ++ return Vec128{wasm_i8x16_shuffle(lo.raw, hi.raw, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24)}; + + case 10: +- return Vec128{wasm_v8x16_shuffle(lo.raw, hi.raw, 10, 11, 12, 13, 14, ++ return Vec128{wasm_i8x16_shuffle(lo.raw, hi.raw, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25)}; + + case 11: +- return Vec128{wasm_v8x16_shuffle(lo.raw, hi.raw, 11, 12, 13, 14, 15, ++ return Vec128{wasm_i8x16_shuffle(lo.raw, hi.raw, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26)}; + + case 12: +- return Vec128{wasm_v8x16_shuffle(lo.raw, hi.raw, 12, 13, 14, 15, 16, ++ return Vec128{wasm_i8x16_shuffle(lo.raw, hi.raw, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27)}; + + case 13: +- return Vec128{wasm_v8x16_shuffle(lo.raw, hi.raw, 13, 14, 15, 16, 17, ++ return Vec128{wasm_i8x16_shuffle(lo.raw, hi.raw, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28)}; + + case 14: +- return Vec128{wasm_v8x16_shuffle(lo.raw, hi.raw, 14, 15, 16, 17, 18, ++ return Vec128{wasm_i8x16_shuffle(lo.raw, hi.raw, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29)}; + + case 15: +- return Vec128{wasm_v8x16_shuffle(lo.raw, hi.raw, 15, 16, 17, 18, 19, ++ return Vec128{wasm_i8x16_shuffle(lo.raw, hi.raw, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30)}; + } +@@ -1613,28 +1763,28 @@ HWY_API Vec128 CombineShiftRightBytes + template + HWY_API Vec128 Broadcast(const Vec128 v) { + static_assert(0 <= kLane && kLane < N, "Invalid lane"); +- return Vec128{wasm_v16x8_shuffle( ++ return Vec128{wasm_i16x8_shuffle( + v.raw, v.raw, kLane, kLane, kLane, kLane, kLane, kLane, kLane, kLane)}; + } + template + HWY_API Vec128 Broadcast(const Vec128 v) { + static_assert(0 <= kLane && kLane < N, "Invalid lane"); + return Vec128{ +- wasm_v32x4_shuffle(v.raw, v.raw, kLane, kLane, kLane, kLane)}; ++ wasm_i32x4_shuffle(v.raw, v.raw, kLane, kLane, kLane, kLane)}; + } + + // Signed + template + HWY_API Vec128 Broadcast(const Vec128 v) { + static_assert(0 <= kLane && kLane < N, "Invalid lane"); +- return Vec128{wasm_v16x8_shuffle( ++ return Vec128{wasm_i16x8_shuffle( + v.raw, v.raw, kLane, kLane, kLane, kLane, kLane, kLane, kLane, kLane)}; + } + template + HWY_API Vec128 Broadcast(const Vec128 v) { + static_assert(0 <= kLane && kLane < N, "Invalid lane"); + return Vec128{ +- wasm_v32x4_shuffle(v.raw, v.raw, kLane, kLane, kLane, kLane)}; ++ wasm_i32x4_shuffle(v.raw, v.raw, kLane, kLane, kLane, kLane)}; + } + + // Float +@@ -1642,7 +1792,7 @@ template + HWY_API Vec128 Broadcast(const Vec128 v) { + static_assert(0 <= kLane && kLane < N, "Invalid lane"); + return Vec128{ +- wasm_v32x4_shuffle(v.raw, v.raw, kLane, kLane, kLane, kLane)}; ++ wasm_i32x4_shuffle(v.raw, v.raw, kLane, kLane, kLane, kLane)}; + } + + // ------------------------------ Shuffle bytes with variable indices +@@ -1652,16 +1802,23 @@ HWY_API Vec128 Broadcast(const + template + HWY_API Vec128 TableLookupBytes(const Vec128 bytes, + const Vec128 from) { +- // TODO(eustas): use swizzle? (shuffle does not work for variable indices) ++// Not yet available in all engines, see ++// https://github.com/WebAssembly/simd/blob/bdcc304b2d379f4601c2c44ea9b44ed9484fde7e/proposals/simd/ImplementationStatus.md ++// V8 implementation of this had a bug, fixed on 2021-04-03: ++// https://chromium-review.googlesource.com/c/v8/v8/+/2822951 ++#if 0 ++ return Vec128{wasm_i8x16_swizzle(bytes.raw, from.raw)}; ++#else + alignas(16) uint8_t control[16]; + alignas(16) uint8_t input[16]; + alignas(16) uint8_t output[16]; + wasm_v128_store(control, from.raw); + wasm_v128_store(input, bytes.raw); + for (size_t i = 0; i < 16; ++i) { +- output[i] = input[control[i]]; ++ output[i] = control[i] < 16 ? input[control[i]] : 0; + } + return Vec128{wasm_v128_load(output)}; ++#endif + } + + // ------------------------------ Hard-coded shuffles +@@ -1673,101 +1830,102 @@ HWY_API Vec128 TableLookupBytes(co + + // Swap 32-bit halves in 64-bit halves. + HWY_API Vec128 Shuffle2301(const Vec128 v) { +- return Vec128{wasm_v32x4_shuffle(v.raw, v.raw, 1, 0, 3, 2)}; ++ return Vec128{wasm_i32x4_shuffle(v.raw, v.raw, 1, 0, 3, 2)}; + } + HWY_API Vec128 Shuffle2301(const Vec128 v) { +- return Vec128{wasm_v32x4_shuffle(v.raw, v.raw, 1, 0, 3, 2)}; ++ return Vec128{wasm_i32x4_shuffle(v.raw, v.raw, 1, 0, 3, 2)}; + } + HWY_API Vec128 Shuffle2301(const Vec128 v) { +- return Vec128{wasm_v32x4_shuffle(v.raw, v.raw, 1, 0, 3, 2)}; ++ return Vec128{wasm_i32x4_shuffle(v.raw, v.raw, 1, 0, 3, 2)}; + } + + // Swap 64-bit halves + HWY_API Vec128 Shuffle1032(const Vec128 v) { +- return Vec128{wasm_v64x2_shuffle(v.raw, v.raw, 1, 0)}; ++ return Vec128{wasm_i64x2_shuffle(v.raw, v.raw, 1, 0)}; + } + HWY_API Vec128 Shuffle1032(const Vec128 v) { +- return Vec128{wasm_v64x2_shuffle(v.raw, v.raw, 1, 0)}; ++ return Vec128{wasm_i64x2_shuffle(v.raw, v.raw, 1, 0)}; + } + HWY_API Vec128 Shuffle1032(const Vec128 v) { +- return Vec128{wasm_v64x2_shuffle(v.raw, v.raw, 1, 0)}; ++ return Vec128{wasm_i64x2_shuffle(v.raw, v.raw, 1, 0)}; + } + + // Rotate right 32 bits + HWY_API Vec128 Shuffle0321(const Vec128 v) { +- return Vec128{wasm_v32x4_shuffle(v.raw, v.raw, 1, 2, 3, 0)}; ++ return Vec128{wasm_i32x4_shuffle(v.raw, v.raw, 1, 2, 3, 0)}; + } + HWY_API Vec128 Shuffle0321(const Vec128 v) { +- return Vec128{wasm_v32x4_shuffle(v.raw, v.raw, 1, 2, 3, 0)}; ++ return Vec128{wasm_i32x4_shuffle(v.raw, v.raw, 1, 2, 3, 0)}; + } + HWY_API Vec128 Shuffle0321(const Vec128 v) { +- return Vec128{wasm_v32x4_shuffle(v.raw, v.raw, 1, 2, 3, 0)}; ++ return Vec128{wasm_i32x4_shuffle(v.raw, v.raw, 1, 2, 3, 0)}; + } + // Rotate left 32 bits + HWY_API Vec128 Shuffle2103(const Vec128 v) { +- return Vec128{wasm_v32x4_shuffle(v.raw, v.raw, 3, 0, 1, 2)}; ++ return Vec128{wasm_i32x4_shuffle(v.raw, v.raw, 3, 0, 1, 2)}; + } + HWY_API Vec128 Shuffle2103(const Vec128 v) { +- return Vec128{wasm_v32x4_shuffle(v.raw, v.raw, 3, 0, 1, 2)}; ++ return Vec128{wasm_i32x4_shuffle(v.raw, v.raw, 3, 0, 1, 2)}; + } + HWY_API Vec128 Shuffle2103(const Vec128 v) { +- return Vec128{wasm_v32x4_shuffle(v.raw, v.raw, 3, 0, 1, 2)}; ++ return Vec128{wasm_i32x4_shuffle(v.raw, v.raw, 3, 0, 1, 2)}; + } + + // Reverse + HWY_API Vec128 Shuffle0123(const Vec128 v) { +- return Vec128{wasm_v32x4_shuffle(v.raw, v.raw, 3, 2, 1, 0)}; ++ return Vec128{wasm_i32x4_shuffle(v.raw, v.raw, 3, 2, 1, 0)}; + } + HWY_API Vec128 Shuffle0123(const Vec128 v) { +- return Vec128{wasm_v32x4_shuffle(v.raw, v.raw, 3, 2, 1, 0)}; ++ return Vec128{wasm_i32x4_shuffle(v.raw, v.raw, 3, 2, 1, 0)}; + } + HWY_API Vec128 Shuffle0123(const Vec128 v) { +- return Vec128{wasm_v32x4_shuffle(v.raw, v.raw, 3, 2, 1, 0)}; ++ return Vec128{wasm_i32x4_shuffle(v.raw, v.raw, 3, 2, 1, 0)}; + } + + // ------------------------------ TableLookupLanes + + // Returned by SetTableIndices for use by TableLookupLanes. +-template ++template + struct Indices128 { + __v128_u raw; + }; + +-template +-HWY_API Indices128 SetTableIndices(Full128, const int32_t* idx) { ++template ++HWY_API Indices128 SetTableIndices(Simd d, const int32_t* idx) { + #if !defined(NDEBUG) || defined(ADDRESS_SANITIZER) +- const size_t N = 16 / sizeof(T); + for (size_t i = 0; i < N; ++i) { + HWY_DASSERT(0 <= idx[i] && idx[i] < static_cast(N)); + } + #endif + +- const Full128 d8; +- alignas(16) uint8_t control[16]; // = Lanes() +- for (size_t idx_byte = 0; idx_byte < 16; ++idx_byte) { +- const size_t idx_lane = idx_byte / sizeof(T); +- const size_t mod = idx_byte % sizeof(T); +- control[idx_byte] = idx[idx_lane] * sizeof(T) + mod; ++ const Repartition d8; ++ alignas(16) uint8_t control[16] = {0}; ++ for (size_t idx_lane = 0; idx_lane < N; ++idx_lane) { ++ for (size_t idx_byte = 0; idx_byte < sizeof(T); ++idx_byte) { ++ control[idx_lane * sizeof(T) + idx_byte] = ++ static_cast(idx[idx_lane] * sizeof(T) + idx_byte); ++ } + } +- return Indices128{Load(d8, control).raw}; ++ return Indices128{Load(d8, control).raw}; + } + +-HWY_API Vec128 TableLookupLanes(const Vec128 v, +- const Indices128 idx) { +- return TableLookupBytes(v, Vec128{idx.raw}); ++template ++HWY_API Vec128 TableLookupLanes( ++ const Vec128 v, const Indices128 idx) { ++ return TableLookupBytes(v, Vec128{idx.raw}); + } +- +-HWY_API Vec128 TableLookupLanes(const Vec128 v, +- const Indices128 idx) { +- return TableLookupBytes(v, Vec128{idx.raw}); ++template ++HWY_API Vec128 TableLookupLanes(const Vec128 v, ++ const Indices128 idx) { ++ return TableLookupBytes(v, Vec128{idx.raw}); + } +- +-HWY_API Vec128 TableLookupLanes(const Vec128 v, +- const Indices128 idx) { +- const Full128 di; +- const Full128 df; ++template ++HWY_API Vec128 TableLookupLanes(const Vec128 v, ++ const Indices128 idx) { ++ const Simd di; ++ const Simd df; + return BitCast(df, +- TableLookupBytes(BitCast(di, v), Vec128{idx.raw})); ++ TableLookupBytes(BitCast(di, v), Vec128{idx.raw})); + } + + // ------------------------------ Zip lanes +@@ -1778,33 +1936,33 @@ HWY_API Vec128 TableLookupLanes(c + template + HWY_API Vec128 ZipLower(const Vec128 a, + const Vec128 b) { +- return Vec128{wasm_v8x16_shuffle( ++ return Vec128{wasm_i8x16_shuffle( + a.raw, b.raw, 0, 16, 1, 17, 2, 18, 3, 19, 4, 20, 5, 21, 6, 22, 7, 23)}; + } + template + HWY_API Vec128 ZipLower(const Vec128 a, + const Vec128 b) { + return Vec128{ +- wasm_v16x8_shuffle(a.raw, b.raw, 0, 8, 1, 9, 2, 10, 3, 11)}; ++ wasm_i16x8_shuffle(a.raw, b.raw, 0, 8, 1, 9, 2, 10, 3, 11)}; + } + + template + HWY_API Vec128 ZipLower(const Vec128 a, + const Vec128 b) { +- return Vec128{wasm_v8x16_shuffle( ++ return Vec128{wasm_i8x16_shuffle( + a.raw, b.raw, 0, 16, 1, 17, 2, 18, 3, 19, 4, 20, 5, 21, 6, 22, 7, 23)}; + } + template + HWY_API Vec128 ZipLower(const Vec128 a, + const Vec128 b) { + return Vec128{ +- wasm_v16x8_shuffle(a.raw, b.raw, 0, 8, 1, 9, 2, 10, 3, 11)}; ++ wasm_i16x8_shuffle(a.raw, b.raw, 0, 8, 1, 9, 2, 10, 3, 11)}; + } + + template + HWY_API Vec128 ZipUpper(const Vec128 a, + const Vec128 b) { +- return Vec128{wasm_v8x16_shuffle(a.raw, b.raw, 8, 24, 9, 25, ++ return Vec128{wasm_i8x16_shuffle(a.raw, b.raw, 8, 24, 9, 25, + 10, 26, 11, 27, 12, 28, 13, + 29, 14, 30, 15, 31)}; + } +@@ -1812,13 +1970,13 @@ template + HWY_API Vec128 ZipUpper(const Vec128 a, + const Vec128 b) { + return Vec128{ +- wasm_v16x8_shuffle(a.raw, b.raw, 4, 12, 5, 13, 6, 14, 7, 15)}; ++ wasm_i16x8_shuffle(a.raw, b.raw, 4, 12, 5, 13, 6, 14, 7, 15)}; + } + + template + HWY_API Vec128 ZipUpper(const Vec128 a, + const Vec128 b) { +- return Vec128{wasm_v8x16_shuffle(a.raw, b.raw, 8, 24, 9, 25, ++ return Vec128{wasm_i8x16_shuffle(a.raw, b.raw, 8, 24, 9, 25, + 10, 26, 11, 27, 12, 28, 13, + 29, 14, 30, 15, 31)}; + } +@@ -1826,7 +1984,7 @@ template + HWY_API Vec128 ZipUpper(const Vec128 a, + const Vec128 b) { + return Vec128{ +- wasm_v16x8_shuffle(a.raw, b.raw, 4, 12, 5, 13, 6, 14, 7, 15)}; ++ wasm_i16x8_shuffle(a.raw, b.raw, 4, 12, 5, 13, 6, 14, 7, 15)}; + } + + // ------------------------------ Interleave lanes +@@ -1842,17 +2000,17 @@ HWY_API Vec128 InterleaveLower(const + template <> + HWY_INLINE Vec128 InterleaveLower( + const Vec128 a, const Vec128 b) { +- return Vec128{wasm_v32x4_shuffle(a.raw, b.raw, 0, 4, 1, 5)}; ++ return Vec128{wasm_i32x4_shuffle(a.raw, b.raw, 0, 4, 1, 5)}; + } + template <> + HWY_INLINE Vec128 InterleaveLower(const Vec128 a, + const Vec128 b) { +- return Vec128{wasm_v32x4_shuffle(a.raw, b.raw, 0, 4, 1, 5)}; ++ return Vec128{wasm_i32x4_shuffle(a.raw, b.raw, 0, 4, 1, 5)}; + } + template <> + HWY_INLINE Vec128 InterleaveLower(const Vec128 a, + const Vec128 b) { +- return Vec128{wasm_v32x4_shuffle(a.raw, b.raw, 0, 4, 1, 5)}; ++ return Vec128{wasm_i32x4_shuffle(a.raw, b.raw, 0, 4, 1, 5)}; + } + + template +@@ -1862,17 +2020,17 @@ HWY_API Vec128 InterleaveUpper(const + template <> + HWY_INLINE Vec128 InterleaveUpper( + const Vec128 a, const Vec128 b) { +- return Vec128{wasm_v32x4_shuffle(a.raw, b.raw, 2, 6, 3, 7)}; ++ return Vec128{wasm_i32x4_shuffle(a.raw, b.raw, 2, 6, 3, 7)}; + } + template <> + HWY_INLINE Vec128 InterleaveUpper(const Vec128 a, + const Vec128 b) { +- return Vec128{wasm_v32x4_shuffle(a.raw, b.raw, 2, 6, 3, 7)}; ++ return Vec128{wasm_i32x4_shuffle(a.raw, b.raw, 2, 6, 3, 7)}; + } + template <> + HWY_INLINE Vec128 InterleaveUpper(const Vec128 a, + const Vec128 b) { +- return Vec128{wasm_v32x4_shuffle(a.raw, b.raw, 2, 6, 3, 7)}; ++ return Vec128{wasm_i32x4_shuffle(a.raw, b.raw, 2, 6, 3, 7)}; + } + + // ------------------------------ Blocks +@@ -1880,13 +2038,13 @@ HWY_INLINE Vec128 InterleaveUpper + // hiH,hiL loH,loL |-> hiL,loL (= lower halves) + template + HWY_API Vec128 ConcatLowerLower(const Vec128 hi, const Vec128 lo) { +- return Vec128{wasm_v64x2_shuffle(lo.raw, hi.raw, 0, 2)}; ++ return Vec128{wasm_i64x2_shuffle(lo.raw, hi.raw, 0, 2)}; + } + + // hiH,hiL loH,loL |-> hiH,loH (= upper halves) + template + HWY_API Vec128 ConcatUpperUpper(const Vec128 hi, const Vec128 lo) { +- return Vec128{wasm_v64x2_shuffle(lo.raw, hi.raw, 1, 3)}; ++ return Vec128{wasm_i64x2_shuffle(lo.raw, hi.raw, 1, 3)}; + } + + // hiH,hiL loH,loL |-> hiL,loH (= inner halves) +@@ -1898,7 +2056,7 @@ HWY_API Vec128 ConcatLowerUpper(const + // hiH,hiL loH,loL |-> hiH,loL (= outer halves) + template + HWY_API Vec128 ConcatUpperLower(const Vec128 hi, const Vec128 lo) { +- return Vec128{wasm_v64x2_shuffle(lo.raw, hi.raw, 0, 3)}; ++ return Vec128{wasm_i64x2_shuffle(lo.raw, hi.raw, 0, 3)}; + } + + // ------------------------------ Odd/even lanes +@@ -1917,12 +2075,12 @@ HWY_API Vec128 odd_even_impl(hwy::Siz + template + HWY_API Vec128 odd_even_impl(hwy::SizeTag<2> /* tag */, const Vec128 a, + const Vec128 b) { +- return Vec128{wasm_v16x8_shuffle(a.raw, b.raw, 8, 1, 10, 3, 12, 5, 14, 7)}; ++ return Vec128{wasm_i16x8_shuffle(a.raw, b.raw, 8, 1, 10, 3, 12, 5, 14, 7)}; + } + template + HWY_API Vec128 odd_even_impl(hwy::SizeTag<4> /* tag */, const Vec128 a, + const Vec128 b) { +- return Vec128{wasm_v32x4_shuffle(a.raw, b.raw, 4, 1, 6, 3)}; ++ return Vec128{wasm_i32x4_shuffle(a.raw, b.raw, 4, 1, 6, 3)}; + } + // TODO(eustas): implement + // template +@@ -1939,7 +2097,7 @@ HWY_API Vec128 OddEven(const Vec128 + HWY_INLINE Vec128 OddEven(const Vec128 a, + const Vec128 b) { +- return Vec128{wasm_v32x4_shuffle(a.raw, b.raw, 4, 1, 6, 3)}; ++ return Vec128{wasm_i32x4_shuffle(a.raw, b.raw, 4, 1, 6, 3)}; + } + + // ================================================== CONVERT +@@ -1950,52 +2108,52 @@ HWY_INLINE Vec128 OddEven( + template + HWY_API Vec128 PromoteTo(Simd /* tag */, + const Vec128 v) { +- return Vec128{wasm_i16x8_widen_low_u8x16(v.raw)}; ++ return Vec128{wasm_u16x8_extend_low_u8x16(v.raw)}; + } + template + HWY_API Vec128 PromoteTo(Simd /* tag */, + const Vec128 v) { + return Vec128{ +- wasm_i32x4_widen_low_u16x8(wasm_i16x8_widen_low_u8x16(v.raw))}; ++ wasm_u32x4_extend_low_u16x8(wasm_u16x8_extend_low_u8x16(v.raw))}; + } + template + HWY_API Vec128 PromoteTo(Simd /* tag */, + const Vec128 v) { +- return Vec128{wasm_i16x8_widen_low_u8x16(v.raw)}; ++ return Vec128{wasm_u16x8_extend_low_u8x16(v.raw)}; + } + template + HWY_API Vec128 PromoteTo(Simd /* tag */, + const Vec128 v) { + return Vec128{ +- wasm_i32x4_widen_low_u16x8(wasm_i16x8_widen_low_u8x16(v.raw))}; ++ wasm_u32x4_extend_low_u16x8(wasm_u16x8_extend_low_u8x16(v.raw))}; + } + template + HWY_API Vec128 PromoteTo(Simd /* tag */, + const Vec128 v) { +- return Vec128{wasm_i32x4_widen_low_u16x8(v.raw)}; ++ return Vec128{wasm_u32x4_extend_low_u16x8(v.raw)}; + } + template + HWY_API Vec128 PromoteTo(Simd /* tag */, + const Vec128 v) { +- return Vec128{wasm_i32x4_widen_low_u16x8(v.raw)}; ++ return Vec128{wasm_u32x4_extend_low_u16x8(v.raw)}; + } + + // Signed: replicate sign bit. + template + HWY_API Vec128 PromoteTo(Simd /* tag */, + const Vec128 v) { +- return Vec128{wasm_i16x8_widen_low_i8x16(v.raw)}; ++ return Vec128{wasm_i16x8_extend_low_i8x16(v.raw)}; + } + template + HWY_API Vec128 PromoteTo(Simd /* tag */, + const Vec128 v) { + return Vec128{ +- wasm_i32x4_widen_low_i16x8(wasm_i16x8_widen_low_i8x16(v.raw))}; ++ wasm_i32x4_extend_low_i16x8(wasm_i16x8_extend_low_i8x16(v.raw))}; + } + template + HWY_API Vec128 PromoteTo(Simd /* tag */, + const Vec128 v) { +- return Vec128{wasm_i32x4_widen_low_i16x8(v.raw)}; ++ return Vec128{wasm_i32x4_extend_low_i16x8(v.raw)}; + } + + template +@@ -2122,7 +2280,7 @@ HWY_API Vec128 U8FromU32(con + wasm_u8x16_narrow_i16x8(intermediate, intermediate)}; + } + +-// ------------------------------ Convert i32 <=> f32 ++// ------------------------------ Convert i32 <=> f32 (Round) + + template + HWY_API Vec128 ConvertTo(Simd /* tag */, +@@ -2133,33 +2291,16 @@ HWY_API Vec128 ConvertTo(Simd< + template + HWY_API Vec128 ConvertTo(Simd /* tag */, + const Vec128 v) { +- return Vec128{wasm_i32x4_trunc_saturate_f32x4(v.raw)}; ++ return Vec128{wasm_i32x4_trunc_sat_f32x4(v.raw)}; + } + + template + HWY_API Vec128 NearestInt(const Vec128 v) { +- const __f32x4 c00 = wasm_f32x4_splat(0.0f); +- const __f32x4 corr = wasm_f32x4_convert_i32x4(wasm_f32x4_le(v.raw, c00)); +- const __f32x4 c05 = wasm_f32x4_splat(0.5f); +- // +0.5 for non-negative lane, -0.5 for other. +- const __f32x4 delta = wasm_f32x4_add(c05, corr); +- // Shift input by 0.5 away from 0. +- const __f32x4 fixed = wasm_f32x4_add(v.raw, delta); +- return Vec128{wasm_i32x4_trunc_saturate_f32x4(fixed)}; ++ return ConvertTo(Simd(), Round(v)); + } + + // ================================================== MISC + +-// Returns a vector with lane i=[0, N) set to "first" + i. +-template +-Vec128 Iota(const Simd d, const T2 first) { +- HWY_ALIGN T lanes[16 / sizeof(T)]; +- for (size_t i = 0; i < 16 / sizeof(T); ++i) { +- lanes[i] = static_cast(first + static_cast(i)); +- } +- return Load(d, lanes); +-} +- + // ------------------------------ Mask + + namespace detail { +@@ -2167,20 +2308,13 @@ namespace detail { + template + HWY_API uint64_t BitsFromMask(hwy::SizeTag<1> /*tag*/, + const Mask128 mask) { +- const __i8x16 slice = +- wasm_i8x16_make(1, 2, 4, 8, 1, 2, 4, 8, 1, 2, 4, 8, 1, 2, 4, 8); +- // Each u32 lane has byte[i] = (1 << i) or 0. +- const __i8x16 v8_4_2_1 = wasm_v128_and(mask.raw, slice); +- // OR together 4 bytes of each u32 to get the 4 bits. +- const __i16x8 v2_1_z_z = wasm_i32x4_shl(v8_4_2_1, 16); +- const __i16x8 v82_41_2_1 = wasm_v128_or(v8_4_2_1, v2_1_z_z); +- const __i16x8 v41_2_1_0 = wasm_i32x4_shl(v82_41_2_1, 8); +- const __i16x8 v8421_421_21_10 = wasm_v128_or(v82_41_2_1, v41_2_1_0); +- const __i16x8 nibble_per_u32 = wasm_i32x4_shr(v8421_421_21_10, 24); +- // Assemble four nibbles into 16 bits. +- alignas(16) uint32_t lanes[4]; +- wasm_v128_store(lanes, nibble_per_u32); +- return lanes[0] | (lanes[1] << 4) | (lanes[2] << 8) | (lanes[3] << 12); ++ alignas(16) uint64_t lanes[2]; ++ wasm_v128_store(lanes, mask.raw); ++ ++ constexpr uint64_t kMagic = 0x103070F1F3F80ULL; ++ const uint64_t lo = ((lanes[0] * kMagic) >> 56); ++ const uint64_t hi = ((lanes[1] * kMagic) >> 48) & 0xFF00; ++ return (hi + lo); + } + + template +@@ -2241,8 +2375,7 @@ constexpr __i8x16 BytesAbove() { + + template + HWY_API uint64_t BitsFromMask(const Mask128 mask) { +- return OnlyActive( +- BitsFromMask(hwy::SizeTag(), mask)); ++ return OnlyActive(BitsFromMask(hwy::SizeTag(), mask)); + } + + template +@@ -2290,7 +2423,15 @@ HWY_API size_t CountTrue(const Mask128 + HWY_API bool AllFalse(const Mask128 m) { +- return !wasm_i8x16_any_true(m.raw); ++#if 0 ++ // Casting followed by wasm_i8x16_any_true results in wasm error: ++ // i32.eqz[0] expected type i32, found i8x16.popcnt of type s128 ++ const auto v8 = BitCast(Full128(), VecFromMask(Full128(), m)); ++ return !wasm_i8x16_any_true(v8.raw); ++#else ++ return (wasm_i64x2_extract_lane(m.raw, 0) | ++ wasm_i64x2_extract_lane(m.raw, 1)) == 0; ++#endif + } + + // Full vector, type-dependent +@@ -2336,6 +2477,139 @@ HWY_API bool AllTrue(const Mask128 + namespace detail { + + template ++HWY_INLINE Vec128 Idx16x8FromBits(const uint64_t mask_bits) { ++ HWY_DASSERT(mask_bits < 256); ++ const Simd d; ++ const Rebind d8; ++ const Simd du; ++ ++ // We need byte indices for TableLookupBytes (one vector's worth for each of ++ // 256 combinations of 8 mask bits). Loading them directly requires 4 KiB. We ++ // can instead store lane indices and convert to byte indices (2*lane + 0..1), ++ // with the doubling baked into the table. Unpacking nibbles is likely more ++ // costly than the higher cache footprint from storing bytes. ++ alignas(16) constexpr uint8_t table[256 * 8] = { ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, ++ 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, ++ 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, ++ 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, ++ 0, 6, 0, 0, 0, 0, 0, 0, 2, 6, 0, 0, 0, 0, 0, 0, 0, 2, ++ 6, 0, 0, 0, 0, 0, 4, 6, 0, 0, 0, 0, 0, 0, 0, 4, 6, 0, ++ 0, 0, 0, 0, 2, 4, 6, 0, 0, 0, 0, 0, 0, 2, 4, 6, 0, 0, ++ 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, ++ 2, 8, 0, 0, 0, 0, 0, 0, 0, 2, 8, 0, 0, 0, 0, 0, 4, 8, ++ 0, 0, 0, 0, 0, 0, 0, 4, 8, 0, 0, 0, 0, 0, 2, 4, 8, 0, ++ 0, 0, 0, 0, 0, 2, 4, 8, 0, 0, 0, 0, 6, 8, 0, 0, 0, 0, ++ 0, 0, 0, 6, 8, 0, 0, 0, 0, 0, 2, 6, 8, 0, 0, 0, 0, 0, ++ 0, 2, 6, 8, 0, 0, 0, 0, 4, 6, 8, 0, 0, 0, 0, 0, 0, 4, ++ 6, 8, 0, 0, 0, 0, 2, 4, 6, 8, 0, 0, 0, 0, 0, 2, 4, 6, ++ 8, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, ++ 0, 0, 2, 10, 0, 0, 0, 0, 0, 0, 0, 2, 10, 0, 0, 0, 0, 0, ++ 4, 10, 0, 0, 0, 0, 0, 0, 0, 4, 10, 0, 0, 0, 0, 0, 2, 4, ++ 10, 0, 0, 0, 0, 0, 0, 2, 4, 10, 0, 0, 0, 0, 6, 10, 0, 0, ++ 0, 0, 0, 0, 0, 6, 10, 0, 0, 0, 0, 0, 2, 6, 10, 0, 0, 0, ++ 0, 0, 0, 2, 6, 10, 0, 0, 0, 0, 4, 6, 10, 0, 0, 0, 0, 0, ++ 0, 4, 6, 10, 0, 0, 0, 0, 2, 4, 6, 10, 0, 0, 0, 0, 0, 2, ++ 4, 6, 10, 0, 0, 0, 8, 10, 0, 0, 0, 0, 0, 0, 0, 8, 10, 0, ++ 0, 0, 0, 0, 2, 8, 10, 0, 0, 0, 0, 0, 0, 2, 8, 10, 0, 0, ++ 0, 0, 4, 8, 10, 0, 0, 0, 0, 0, 0, 4, 8, 10, 0, 0, 0, 0, ++ 2, 4, 8, 10, 0, 0, 0, 0, 0, 2, 4, 8, 10, 0, 0, 0, 6, 8, ++ 10, 0, 0, 0, 0, 0, 0, 6, 8, 10, 0, 0, 0, 0, 2, 6, 8, 10, ++ 0, 0, 0, 0, 0, 2, 6, 8, 10, 0, 0, 0, 4, 6, 8, 10, 0, 0, ++ 0, 0, 0, 4, 6, 8, 10, 0, 0, 0, 2, 4, 6, 8, 10, 0, 0, 0, ++ 0, 2, 4, 6, 8, 10, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 12, ++ 0, 0, 0, 0, 0, 0, 2, 12, 0, 0, 0, 0, 0, 0, 0, 2, 12, 0, ++ 0, 0, 0, 0, 4, 12, 0, 0, 0, 0, 0, 0, 0, 4, 12, 0, 0, 0, ++ 0, 0, 2, 4, 12, 0, 0, 0, 0, 0, 0, 2, 4, 12, 0, 0, 0, 0, ++ 6, 12, 0, 0, 0, 0, 0, 0, 0, 6, 12, 0, 0, 0, 0, 0, 2, 6, ++ 12, 0, 0, 0, 0, 0, 0, 2, 6, 12, 0, 0, 0, 0, 4, 6, 12, 0, ++ 0, 0, 0, 0, 0, 4, 6, 12, 0, 0, 0, 0, 2, 4, 6, 12, 0, 0, ++ 0, 0, 0, 2, 4, 6, 12, 0, 0, 0, 8, 12, 0, 0, 0, 0, 0, 0, ++ 0, 8, 12, 0, 0, 0, 0, 0, 2, 8, 12, 0, 0, 0, 0, 0, 0, 2, ++ 8, 12, 0, 0, 0, 0, 4, 8, 12, 0, 0, 0, 0, 0, 0, 4, 8, 12, ++ 0, 0, 0, 0, 2, 4, 8, 12, 0, 0, 0, 0, 0, 2, 4, 8, 12, 0, ++ 0, 0, 6, 8, 12, 0, 0, 0, 0, 0, 0, 6, 8, 12, 0, 0, 0, 0, ++ 2, 6, 8, 12, 0, 0, 0, 0, 0, 2, 6, 8, 12, 0, 0, 0, 4, 6, ++ 8, 12, 0, 0, 0, 0, 0, 4, 6, 8, 12, 0, 0, 0, 2, 4, 6, 8, ++ 12, 0, 0, 0, 0, 2, 4, 6, 8, 12, 0, 0, 10, 12, 0, 0, 0, 0, ++ 0, 0, 0, 10, 12, 0, 0, 0, 0, 0, 2, 10, 12, 0, 0, 0, 0, 0, ++ 0, 2, 10, 12, 0, 0, 0, 0, 4, 10, 12, 0, 0, 0, 0, 0, 0, 4, ++ 10, 12, 0, 0, 0, 0, 2, 4, 10, 12, 0, 0, 0, 0, 0, 2, 4, 10, ++ 12, 0, 0, 0, 6, 10, 12, 0, 0, 0, 0, 0, 0, 6, 10, 12, 0, 0, ++ 0, 0, 2, 6, 10, 12, 0, 0, 0, 0, 0, 2, 6, 10, 12, 0, 0, 0, ++ 4, 6, 10, 12, 0, 0, 0, 0, 0, 4, 6, 10, 12, 0, 0, 0, 2, 4, ++ 6, 10, 12, 0, 0, 0, 0, 2, 4, 6, 10, 12, 0, 0, 8, 10, 12, 0, ++ 0, 0, 0, 0, 0, 8, 10, 12, 0, 0, 0, 0, 2, 8, 10, 12, 0, 0, ++ 0, 0, 0, 2, 8, 10, 12, 0, 0, 0, 4, 8, 10, 12, 0, 0, 0, 0, ++ 0, 4, 8, 10, 12, 0, 0, 0, 2, 4, 8, 10, 12, 0, 0, 0, 0, 2, ++ 4, 8, 10, 12, 0, 0, 6, 8, 10, 12, 0, 0, 0, 0, 0, 6, 8, 10, ++ 12, 0, 0, 0, 2, 6, 8, 10, 12, 0, 0, 0, 0, 2, 6, 8, 10, 12, ++ 0, 0, 4, 6, 8, 10, 12, 0, 0, 0, 0, 4, 6, 8, 10, 12, 0, 0, ++ 2, 4, 6, 8, 10, 12, 0, 0, 0, 2, 4, 6, 8, 10, 12, 0, 14, 0, ++ 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 2, 14, 0, 0, ++ 0, 0, 0, 0, 0, 2, 14, 0, 0, 0, 0, 0, 4, 14, 0, 0, 0, 0, ++ 0, 0, 0, 4, 14, 0, 0, 0, 0, 0, 2, 4, 14, 0, 0, 0, 0, 0, ++ 0, 2, 4, 14, 0, 0, 0, 0, 6, 14, 0, 0, 0, 0, 0, 0, 0, 6, ++ 14, 0, 0, 0, 0, 0, 2, 6, 14, 0, 0, 0, 0, 0, 0, 2, 6, 14, ++ 0, 0, 0, 0, 4, 6, 14, 0, 0, 0, 0, 0, 0, 4, 6, 14, 0, 0, ++ 0, 0, 2, 4, 6, 14, 0, 0, 0, 0, 0, 2, 4, 6, 14, 0, 0, 0, ++ 8, 14, 0, 0, 0, 0, 0, 0, 0, 8, 14, 0, 0, 0, 0, 0, 2, 8, ++ 14, 0, 0, 0, 0, 0, 0, 2, 8, 14, 0, 0, 0, 0, 4, 8, 14, 0, ++ 0, 0, 0, 0, 0, 4, 8, 14, 0, 0, 0, 0, 2, 4, 8, 14, 0, 0, ++ 0, 0, 0, 2, 4, 8, 14, 0, 0, 0, 6, 8, 14, 0, 0, 0, 0, 0, ++ 0, 6, 8, 14, 0, 0, 0, 0, 2, 6, 8, 14, 0, 0, 0, 0, 0, 2, ++ 6, 8, 14, 0, 0, 0, 4, 6, 8, 14, 0, 0, 0, 0, 0, 4, 6, 8, ++ 14, 0, 0, 0, 2, 4, 6, 8, 14, 0, 0, 0, 0, 2, 4, 6, 8, 14, ++ 0, 0, 10, 14, 0, 0, 0, 0, 0, 0, 0, 10, 14, 0, 0, 0, 0, 0, ++ 2, 10, 14, 0, 0, 0, 0, 0, 0, 2, 10, 14, 0, 0, 0, 0, 4, 10, ++ 14, 0, 0, 0, 0, 0, 0, 4, 10, 14, 0, 0, 0, 0, 2, 4, 10, 14, ++ 0, 0, 0, 0, 0, 2, 4, 10, 14, 0, 0, 0, 6, 10, 14, 0, 0, 0, ++ 0, 0, 0, 6, 10, 14, 0, 0, 0, 0, 2, 6, 10, 14, 0, 0, 0, 0, ++ 0, 2, 6, 10, 14, 0, 0, 0, 4, 6, 10, 14, 0, 0, 0, 0, 0, 4, ++ 6, 10, 14, 0, 0, 0, 2, 4, 6, 10, 14, 0, 0, 0, 0, 2, 4, 6, ++ 10, 14, 0, 0, 8, 10, 14, 0, 0, 0, 0, 0, 0, 8, 10, 14, 0, 0, ++ 0, 0, 2, 8, 10, 14, 0, 0, 0, 0, 0, 2, 8, 10, 14, 0, 0, 0, ++ 4, 8, 10, 14, 0, 0, 0, 0, 0, 4, 8, 10, 14, 0, 0, 0, 2, 4, ++ 8, 10, 14, 0, 0, 0, 0, 2, 4, 8, 10, 14, 0, 0, 6, 8, 10, 14, ++ 0, 0, 0, 0, 0, 6, 8, 10, 14, 0, 0, 0, 2, 6, 8, 10, 14, 0, ++ 0, 0, 0, 2, 6, 8, 10, 14, 0, 0, 4, 6, 8, 10, 14, 0, 0, 0, ++ 0, 4, 6, 8, 10, 14, 0, 0, 2, 4, 6, 8, 10, 14, 0, 0, 0, 2, ++ 4, 6, 8, 10, 14, 0, 12, 14, 0, 0, 0, 0, 0, 0, 0, 12, 14, 0, ++ 0, 0, 0, 0, 2, 12, 14, 0, 0, 0, 0, 0, 0, 2, 12, 14, 0, 0, ++ 0, 0, 4, 12, 14, 0, 0, 0, 0, 0, 0, 4, 12, 14, 0, 0, 0, 0, ++ 2, 4, 12, 14, 0, 0, 0, 0, 0, 2, 4, 12, 14, 0, 0, 0, 6, 12, ++ 14, 0, 0, 0, 0, 0, 0, 6, 12, 14, 0, 0, 0, 0, 2, 6, 12, 14, ++ 0, 0, 0, 0, 0, 2, 6, 12, 14, 0, 0, 0, 4, 6, 12, 14, 0, 0, ++ 0, 0, 0, 4, 6, 12, 14, 0, 0, 0, 2, 4, 6, 12, 14, 0, 0, 0, ++ 0, 2, 4, 6, 12, 14, 0, 0, 8, 12, 14, 0, 0, 0, 0, 0, 0, 8, ++ 12, 14, 0, 0, 0, 0, 2, 8, 12, 14, 0, 0, 0, 0, 0, 2, 8, 12, ++ 14, 0, 0, 0, 4, 8, 12, 14, 0, 0, 0, 0, 0, 4, 8, 12, 14, 0, ++ 0, 0, 2, 4, 8, 12, 14, 0, 0, 0, 0, 2, 4, 8, 12, 14, 0, 0, ++ 6, 8, 12, 14, 0, 0, 0, 0, 0, 6, 8, 12, 14, 0, 0, 0, 2, 6, ++ 8, 12, 14, 0, 0, 0, 0, 2, 6, 8, 12, 14, 0, 0, 4, 6, 8, 12, ++ 14, 0, 0, 0, 0, 4, 6, 8, 12, 14, 0, 0, 2, 4, 6, 8, 12, 14, ++ 0, 0, 0, 2, 4, 6, 8, 12, 14, 0, 10, 12, 14, 0, 0, 0, 0, 0, ++ 0, 10, 12, 14, 0, 0, 0, 0, 2, 10, 12, 14, 0, 0, 0, 0, 0, 2, ++ 10, 12, 14, 0, 0, 0, 4, 10, 12, 14, 0, 0, 0, 0, 0, 4, 10, 12, ++ 14, 0, 0, 0, 2, 4, 10, 12, 14, 0, 0, 0, 0, 2, 4, 10, 12, 14, ++ 0, 0, 6, 10, 12, 14, 0, 0, 0, 0, 0, 6, 10, 12, 14, 0, 0, 0, ++ 2, 6, 10, 12, 14, 0, 0, 0, 0, 2, 6, 10, 12, 14, 0, 0, 4, 6, ++ 10, 12, 14, 0, 0, 0, 0, 4, 6, 10, 12, 14, 0, 0, 2, 4, 6, 10, ++ 12, 14, 0, 0, 0, 2, 4, 6, 10, 12, 14, 0, 8, 10, 12, 14, 0, 0, ++ 0, 0, 0, 8, 10, 12, 14, 0, 0, 0, 2, 8, 10, 12, 14, 0, 0, 0, ++ 0, 2, 8, 10, 12, 14, 0, 0, 4, 8, 10, 12, 14, 0, 0, 0, 0, 4, ++ 8, 10, 12, 14, 0, 0, 2, 4, 8, 10, 12, 14, 0, 0, 0, 2, 4, 8, ++ 10, 12, 14, 0, 6, 8, 10, 12, 14, 0, 0, 0, 0, 6, 8, 10, 12, 14, ++ 0, 0, 2, 6, 8, 10, 12, 14, 0, 0, 0, 2, 6, 8, 10, 12, 14, 0, ++ 4, 6, 8, 10, 12, 14, 0, 0, 0, 4, 6, 8, 10, 12, 14, 0, 2, 4, ++ 6, 8, 10, 12, 14, 0, 0, 2, 4, 6, 8, 10, 12, 14}; ++ ++ const Vec128 byte_idx{Load(d8, table + mask_bits * 8).raw}; ++ const Vec128 pairs = ZipLower(byte_idx, byte_idx); ++ return BitCast(d, pairs + Set(du, 0x0100)); ++} ++ ++template + HWY_INLINE Vec128 Idx32x4FromBits(const uint64_t mask_bits) { + HWY_DASSERT(mask_bits < 16); + +@@ -2383,57 +2657,37 @@ HWY_INLINE Vec128 Idx64x2FromBits( + + #endif + +-// Helper function called by both Compress and CompressStore - avoids a ++// Helper functions called by both Compress and CompressStore - avoids a + // redundant BitsFromMask in the latter. + +-template +-HWY_API Vec128 Compress(Vec128 v, +- const uint64_t mask_bits) { +- const auto idx = detail::Idx32x4FromBits(mask_bits); +- return TableLookupBytes(v, idx); ++template ++HWY_API Vec128 Compress(hwy::SizeTag<2> /*tag*/, Vec128 v, ++ const uint64_t mask_bits) { ++ const auto idx = detail::Idx16x8FromBits(mask_bits); ++ using D = Simd; ++ const RebindToSigned di; ++ return BitCast(D(), TableLookupBytes(BitCast(di, v), BitCast(di, idx))); + } +-template +-HWY_API Vec128 Compress(Vec128 v, +- const uint64_t mask_bits) { +- const auto idx = detail::Idx32x4FromBits(mask_bits); +- return TableLookupBytes(v, idx); ++ ++template ++HWY_API Vec128 Compress(hwy::SizeTag<4> /*tag*/, Vec128 v, ++ const uint64_t mask_bits) { ++ const auto idx = detail::Idx32x4FromBits(mask_bits); ++ using D = Simd; ++ const RebindToSigned di; ++ return BitCast(D(), TableLookupBytes(BitCast(di, v), BitCast(di, idx))); + } + +-#if HWY_CAP_INTEGER64 ++#if HWY_CAP_INTEGER64 || HWY_CAP_FLOAT64 + +-template +-HWY_API Vec128 Compress(Vec128 v, ++template ++HWY_API Vec128 Compress(hwy::SizeTag<8> /*tag*/, ++ Vec128 v, + const uint64_t mask_bits) { + const auto idx = detail::Idx64x2FromBits(mask_bits); +- return TableLookupBytes(v, idx); +-} +-template +-HWY_API Vec128 Compress(Vec128 v, +- const uint64_t mask_bits) { +- const auto idx = detail::Idx64x2FromBits(mask_bits); +- return TableLookupBytes(v, idx); +-} +- +-#endif +- +-template +-HWY_API Vec128 Compress(Vec128 v, +- const uint64_t mask_bits) { +- const auto idx = detail::Idx32x4FromBits(mask_bits); +- const Simd df; +- const Simd di; +- return BitCast(df, TableLookupBytes(BitCast(di, v), idx)); +-} +- +-#if HWY_CAP_FLOAT64 +- +-template +-HWY_API Vec128 Compress(Vec128 v, +- const uint64_t mask_bits) { +- const auto idx = detail::Idx64x2FromBits(mask_bits); +- const Simd df; +- const Simd di; +- return BitCast(df, TableLookupBytes(BitCast(di, v), idx)); ++ using D = Simd; ++ const RebindToSigned di; ++ return BitCast(D(), TableLookupBytes(BitCast(di, v), BitCast(di, idx))); + } + + #endif +@@ -2442,7 +2696,8 @@ HWY_API Vec128 Compress(Vec12 + + template + HWY_API Vec128 Compress(Vec128 v, const Mask128 mask) { +- return detail::Compress(v, detail::BitsFromMask(mask)); ++ return detail::Compress(hwy::SizeTag(), v, ++ detail::BitsFromMask(mask)); + } + + // ------------------------------ CompressStore +@@ -2451,63 +2706,284 @@ template + HWY_API size_t CompressStore(Vec128 v, const Mask128 mask, + Simd d, T* HWY_RESTRICT aligned) { + const uint64_t mask_bits = detail::BitsFromMask(mask); +- Store(detail::Compress(v, mask_bits), d, aligned); ++ Store(detail::Compress(hwy::SizeTag(), v, mask_bits), d, aligned); + return PopCount(mask_bits); + } + ++// ------------------------------ StoreInterleaved3 (CombineShiftRightBytes, ++// TableLookupBytes) ++ ++// 128 bits ++HWY_API void StoreInterleaved3(const Vec128 a, const Vec128 b, ++ const Vec128 c, Full128 d, ++ uint8_t* HWY_RESTRICT unaligned) { ++ const auto k5 = Set(d, 5); ++ const auto k6 = Set(d, 6); ++ ++ // Shuffle (a,b,c) vector bytes to (MSB on left): r5, bgr[4:0]. ++ // 0x80 so lanes to be filled from other vectors are 0 for blending. ++ alignas(16) static constexpr uint8_t tbl_r0[16] = { ++ 0, 0x80, 0x80, 1, 0x80, 0x80, 2, 0x80, 0x80, // ++ 3, 0x80, 0x80, 4, 0x80, 0x80, 5}; ++ alignas(16) static constexpr uint8_t tbl_g0[16] = { ++ 0x80, 0, 0x80, 0x80, 1, 0x80, // ++ 0x80, 2, 0x80, 0x80, 3, 0x80, 0x80, 4, 0x80, 0x80}; ++ const auto shuf_r0 = Load(d, tbl_r0); ++ const auto shuf_g0 = Load(d, tbl_g0); // cannot reuse r0 due to 5 in MSB ++ const auto shuf_b0 = CombineShiftRightBytes<15>(shuf_g0, shuf_g0); ++ const auto r0 = TableLookupBytes(a, shuf_r0); // 5..4..3..2..1..0 ++ const auto g0 = TableLookupBytes(b, shuf_g0); // ..4..3..2..1..0. ++ const auto b0 = TableLookupBytes(c, shuf_b0); // .4..3..2..1..0.. ++ const auto int0 = r0 | g0 | b0; ++ StoreU(int0, d, unaligned + 0 * 16); ++ ++ // Second vector: g10,r10, bgr[9:6], b5,g5 ++ const auto shuf_r1 = shuf_b0 + k6; // .A..9..8..7..6.. ++ const auto shuf_g1 = shuf_r0 + k5; // A..9..8..7..6..5 ++ const auto shuf_b1 = shuf_g0 + k5; // ..9..8..7..6..5. ++ const auto r1 = TableLookupBytes(a, shuf_r1); ++ const auto g1 = TableLookupBytes(b, shuf_g1); ++ const auto b1 = TableLookupBytes(c, shuf_b1); ++ const auto int1 = r1 | g1 | b1; ++ StoreU(int1, d, unaligned + 1 * 16); ++ ++ // Third vector: bgr[15:11], b10 ++ const auto shuf_r2 = shuf_b1 + k6; // ..F..E..D..C..B. ++ const auto shuf_g2 = shuf_r1 + k5; // .F..E..D..C..B.. ++ const auto shuf_b2 = shuf_g1 + k5; // F..E..D..C..B..A ++ const auto r2 = TableLookupBytes(a, shuf_r2); ++ const auto g2 = TableLookupBytes(b, shuf_g2); ++ const auto b2 = TableLookupBytes(c, shuf_b2); ++ const auto int2 = r2 | g2 | b2; ++ StoreU(int2, d, unaligned + 2 * 16); ++} ++ ++// 64 bits ++HWY_API void StoreInterleaved3(const Vec128 a, ++ const Vec128 b, ++ const Vec128 c, Simd d, ++ uint8_t* HWY_RESTRICT unaligned) { ++ // Use full vectors for the shuffles and first result. ++ const Full128 d_full; ++ const auto k5 = Set(d_full, 5); ++ const auto k6 = Set(d_full, 6); ++ ++ const Vec128 full_a{a.raw}; ++ const Vec128 full_b{b.raw}; ++ const Vec128 full_c{c.raw}; ++ ++ // Shuffle (a,b,c) vector bytes to (MSB on left): r5, bgr[4:0]. ++ // 0x80 so lanes to be filled from other vectors are 0 for blending. ++ alignas(16) static constexpr uint8_t tbl_r0[16] = { ++ 0, 0x80, 0x80, 1, 0x80, 0x80, 2, 0x80, 0x80, // ++ 3, 0x80, 0x80, 4, 0x80, 0x80, 5}; ++ alignas(16) static constexpr uint8_t tbl_g0[16] = { ++ 0x80, 0, 0x80, 0x80, 1, 0x80, // ++ 0x80, 2, 0x80, 0x80, 3, 0x80, 0x80, 4, 0x80, 0x80}; ++ const auto shuf_r0 = Load(d_full, tbl_r0); ++ const auto shuf_g0 = Load(d_full, tbl_g0); // cannot reuse r0 due to 5 in MSB ++ const auto shuf_b0 = CombineShiftRightBytes<15>(shuf_g0, shuf_g0); ++ const auto r0 = TableLookupBytes(full_a, shuf_r0); // 5..4..3..2..1..0 ++ const auto g0 = TableLookupBytes(full_b, shuf_g0); // ..4..3..2..1..0. ++ const auto b0 = TableLookupBytes(full_c, shuf_b0); // .4..3..2..1..0.. ++ const auto int0 = r0 | g0 | b0; ++ StoreU(int0, d_full, unaligned + 0 * 16); ++ ++ // Second (HALF) vector: bgr[7:6], b5,g5 ++ const auto shuf_r1 = shuf_b0 + k6; // ..7..6.. ++ const auto shuf_g1 = shuf_r0 + k5; // .7..6..5 ++ const auto shuf_b1 = shuf_g0 + k5; // 7..6..5. ++ const auto r1 = TableLookupBytes(full_a, shuf_r1); ++ const auto g1 = TableLookupBytes(full_b, shuf_g1); ++ const auto b1 = TableLookupBytes(full_c, shuf_b1); ++ const decltype(Zero(d)) int1{(r1 | g1 | b1).raw}; ++ StoreU(int1, d, unaligned + 1 * 16); ++} ++ ++// <= 32 bits ++template ++HWY_API void StoreInterleaved3(const Vec128 a, ++ const Vec128 b, ++ const Vec128 c, ++ Simd /*tag*/, ++ uint8_t* HWY_RESTRICT unaligned) { ++ // Use full vectors for the shuffles and result. ++ const Full128 d_full; ++ ++ const Vec128 full_a{a.raw}; ++ const Vec128 full_b{b.raw}; ++ const Vec128 full_c{c.raw}; ++ ++ // Shuffle (a,b,c) vector bytes to bgr[3:0]. ++ // 0x80 so lanes to be filled from other vectors are 0 for blending. ++ alignas(16) static constexpr uint8_t tbl_r0[16] = { ++ 0, 0x80, 0x80, 1, 0x80, 0x80, 2, 0x80, 0x80, 3, 0x80, 0x80, // ++ 0x80, 0x80, 0x80, 0x80}; ++ const auto shuf_r0 = Load(d_full, tbl_r0); ++ const auto shuf_g0 = CombineShiftRightBytes<15>(shuf_r0, shuf_r0); ++ const auto shuf_b0 = CombineShiftRightBytes<14>(shuf_r0, shuf_r0); ++ const auto r0 = TableLookupBytes(full_a, shuf_r0); // ......3..2..1..0 ++ const auto g0 = TableLookupBytes(full_b, shuf_g0); // .....3..2..1..0. ++ const auto b0 = TableLookupBytes(full_c, shuf_b0); // ....3..2..1..0.. ++ const auto int0 = r0 | g0 | b0; ++ alignas(16) uint8_t buf[16]; ++ StoreU(int0, d_full, buf); ++ CopyBytes(buf, unaligned); ++} ++ ++// ------------------------------ StoreInterleaved4 ++ ++// 128 bits ++HWY_API void StoreInterleaved4(const Vec128 v0, ++ const Vec128 v1, ++ const Vec128 v2, ++ const Vec128 v3, Full128 d, ++ uint8_t* HWY_RESTRICT unaligned) { ++ // let a,b,c,d denote v0..3. ++ const auto ba0 = ZipLower(v0, v1); // b7 a7 .. b0 a0 ++ const auto dc0 = ZipLower(v2, v3); // d7 c7 .. d0 c0 ++ const auto ba8 = ZipUpper(v0, v1); ++ const auto dc8 = ZipUpper(v2, v3); ++ const auto dcba_0 = ZipLower(ba0, dc0); // d..a3 d..a0 ++ const auto dcba_4 = ZipUpper(ba0, dc0); // d..a7 d..a4 ++ const auto dcba_8 = ZipLower(ba8, dc8); // d..aB d..a8 ++ const auto dcba_C = ZipUpper(ba8, dc8); // d..aF d..aC ++ StoreU(BitCast(d, dcba_0), d, unaligned + 0 * 16); ++ StoreU(BitCast(d, dcba_4), d, unaligned + 1 * 16); ++ StoreU(BitCast(d, dcba_8), d, unaligned + 2 * 16); ++ StoreU(BitCast(d, dcba_C), d, unaligned + 3 * 16); ++} ++ ++// 64 bits ++HWY_API void StoreInterleaved4(const Vec128 in0, ++ const Vec128 in1, ++ const Vec128 in2, ++ const Vec128 in3, ++ Simd /*tag*/, ++ uint8_t* HWY_RESTRICT unaligned) { ++ // Use full vectors to reduce the number of stores. ++ const Vec128 v0{in0.raw}; ++ const Vec128 v1{in1.raw}; ++ const Vec128 v2{in2.raw}; ++ const Vec128 v3{in3.raw}; ++ // let a,b,c,d denote v0..3. ++ const auto ba0 = ZipLower(v0, v1); // b7 a7 .. b0 a0 ++ const auto dc0 = ZipLower(v2, v3); // d7 c7 .. d0 c0 ++ const auto dcba_0 = ZipLower(ba0, dc0); // d..a3 d..a0 ++ const auto dcba_4 = ZipUpper(ba0, dc0); // d..a7 d..a4 ++ const Full128 d_full; ++ StoreU(BitCast(d_full, dcba_0), d_full, unaligned + 0 * 16); ++ StoreU(BitCast(d_full, dcba_4), d_full, unaligned + 1 * 16); ++} ++ ++// <= 32 bits ++template ++HWY_API void StoreInterleaved4(const Vec128 in0, ++ const Vec128 in1, ++ const Vec128 in2, ++ const Vec128 in3, ++ Simd /*tag*/, ++ uint8_t* HWY_RESTRICT unaligned) { ++ // Use full vectors to reduce the number of stores. ++ const Vec128 v0{in0.raw}; ++ const Vec128 v1{in1.raw}; ++ const Vec128 v2{in2.raw}; ++ const Vec128 v3{in3.raw}; ++ // let a,b,c,d denote v0..3. ++ const auto ba0 = ZipLower(v0, v1); // b3 a3 .. b0 a0 ++ const auto dc0 = ZipLower(v2, v3); // d3 c3 .. d0 c0 ++ const auto dcba_0 = ZipLower(ba0, dc0); // d..a3 d..a0 ++ alignas(16) uint8_t buf[16]; ++ const Full128 d_full; ++ StoreU(BitCast(d_full, dcba_0), d_full, buf); ++ CopyBytes<4 * N>(buf, unaligned); ++} ++ + // ------------------------------ Reductions + + namespace detail { + +-// For u32/i32/f32. +-template +-HWY_API Vec128 SumOfLanes(hwy::SizeTag<4> /* tag */, +- const Vec128 v3210) { ++// N=1 for any T: no-op ++template ++HWY_API Vec128 SumOfLanes(hwy::SizeTag /* tag */, ++ const Vec128 v) { ++ return v; ++} ++template ++HWY_API Vec128 MinOfLanes(hwy::SizeTag /* tag */, ++ const Vec128 v) { ++ return v; ++} ++template ++HWY_API Vec128 MaxOfLanes(hwy::SizeTag /* tag */, ++ const Vec128 v) { ++ return v; ++} ++ ++// u32/i32/f32: ++ ++// N=2 ++template ++HWY_API Vec128 SumOfLanes(hwy::SizeTag<4> /* tag */, ++ const Vec128 v10) { ++ return v10 + Vec128{Shuffle2301(Vec128{v10.raw}).raw}; ++} ++template ++HWY_API Vec128 MinOfLanes(hwy::SizeTag<4> /* tag */, ++ const Vec128 v10) { ++ return Min(v10, Vec128{Shuffle2301(Vec128{v10.raw}).raw}); ++} ++template ++HWY_API Vec128 MaxOfLanes(hwy::SizeTag<4> /* tag */, ++ const Vec128 v10) { ++ return Max(v10, Vec128{Shuffle2301(Vec128{v10.raw}).raw}); ++} ++ ++// N=4 (full) ++template ++HWY_API Vec128 SumOfLanes(hwy::SizeTag<4> /* tag */, const Vec128 v3210) { + const Vec128 v1032 = Shuffle1032(v3210); + const Vec128 v31_20_31_20 = v3210 + v1032; + const Vec128 v20_31_20_31 = Shuffle0321(v31_20_31_20); + return v20_31_20_31 + v31_20_31_20; + } +-template +-HWY_API Vec128 MinOfLanes(hwy::SizeTag<4> /* tag */, +- const Vec128 v3210) { ++template ++HWY_API Vec128 MinOfLanes(hwy::SizeTag<4> /* tag */, const Vec128 v3210) { + const Vec128 v1032 = Shuffle1032(v3210); + const Vec128 v31_20_31_20 = Min(v3210, v1032); + const Vec128 v20_31_20_31 = Shuffle0321(v31_20_31_20); + return Min(v20_31_20_31, v31_20_31_20); + } +-template +-HWY_API Vec128 MaxOfLanes(hwy::SizeTag<4> /* tag */, +- const Vec128 v3210) { ++template ++HWY_API Vec128 MaxOfLanes(hwy::SizeTag<4> /* tag */, const Vec128 v3210) { + const Vec128 v1032 = Shuffle1032(v3210); + const Vec128 v31_20_31_20 = Max(v3210, v1032); + const Vec128 v20_31_20_31 = Shuffle0321(v31_20_31_20); + return Max(v20_31_20_31, v31_20_31_20); + } + +-// For u64/i64/f64. +-template +-HWY_API Vec128 SumOfLanes(hwy::SizeTag<8> /* tag */, +- const Vec128 v10) { ++// u64/i64/f64: ++ ++// N=2 (full) ++template ++HWY_API Vec128 SumOfLanes(hwy::SizeTag<8> /* tag */, const Vec128 v10) { + const Vec128 v01 = Shuffle01(v10); + return v10 + v01; + } +-template +-HWY_API Vec128 MinOfLanes(hwy::SizeTag<8> /* tag */, +- const Vec128 v10) { ++template ++HWY_API Vec128 MinOfLanes(hwy::SizeTag<8> /* tag */, const Vec128 v10) { + const Vec128 v01 = Shuffle01(v10); + return Min(v10, v01); + } +-template +-HWY_API Vec128 MaxOfLanes(hwy::SizeTag<8> /* tag */, +- const Vec128 v10) { ++template ++HWY_API Vec128 MaxOfLanes(hwy::SizeTag<8> /* tag */, const Vec128 v10) { + const Vec128 v01 = Shuffle01(v10); + return Max(v10, v01); + } + + } // namespace detail + +-// Supported for u/i/f 32/64. Returns the sum in each lane. ++// Supported for u/i/f 32/64. Returns the same value in each lane. + template + HWY_API Vec128 SumOfLanes(const Vec128 v) { + return detail::SumOfLanes(hwy::SizeTag(), v); +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/ops/wasm_128-inl.hE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/ops/wasm_128-inl.hE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/ops/x86_128-inl.h.12 chromium-91.0.4472.77/third_party/highway/src/hwy/ops/x86_128-inl.h +--- chromium-91.0.4472.77/third_party/highway/src/hwy/ops/x86_128-inl.h.12 2021-06-02 10:56:05.240904417 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/ops/x86_128-inl.h 2021-05-31 10:37:11.000000000 -0400 +@@ -154,27 +154,28 @@ HWY_API Vec128 Zero(Simd + HWY_API Vec128 Set(Simd /* tag */, const uint8_t t) { +- return Vec128{_mm_set1_epi8(t)}; ++ return Vec128{_mm_set1_epi8(static_cast(t))}; // NOLINT + } + template + HWY_API Vec128 Set(Simd /* tag */, const uint16_t t) { +- return Vec128{_mm_set1_epi16(t)}; ++ return Vec128{_mm_set1_epi16(static_cast(t))}; // NOLINT + } + template + HWY_API Vec128 Set(Simd /* tag */, const uint32_t t) { +- return Vec128{_mm_set1_epi32(t)}; ++ return Vec128{_mm_set1_epi32(static_cast(t))}; + } + template + HWY_API Vec128 Set(Simd /* tag */, const uint64_t t) { +- return Vec128{_mm_set1_epi64x(t)}; ++ return Vec128{ ++ _mm_set1_epi64x(static_cast(t))}; // NOLINT + } + template + HWY_API Vec128 Set(Simd /* tag */, const int8_t t) { +- return Vec128{_mm_set1_epi8(t)}; ++ return Vec128{_mm_set1_epi8(static_cast(t))}; // NOLINT + } + template + HWY_API Vec128 Set(Simd /* tag */, const int16_t t) { +- return Vec128{_mm_set1_epi16(t)}; ++ return Vec128{_mm_set1_epi16(static_cast(t))}; // NOLINT + } + template + HWY_API Vec128 Set(Simd /* tag */, const int32_t t) { +@@ -182,7 +183,8 @@ HWY_API Vec128 Set(Simd + HWY_API Vec128 Set(Simd /* tag */, const int64_t t) { +- return Vec128{_mm_set1_epi64x(t)}; ++ return Vec128{ ++ _mm_set1_epi64x(static_cast(t))}; // NOLINT + } + template + HWY_API Vec128 Set(Simd /* tag */, const float t) { +@@ -510,7 +512,8 @@ HWY_API Mask128 Xor(const Mask128< + template + HWY_API Mask128 RebindMask(Simd /*tag*/, Mask128 m) { + static_assert(sizeof(TFrom) == sizeof(TTo), "Must have same size"); +- return Mask128{m.raw}; ++ const Simd d; ++ return MaskFromVec(BitCast(Simd(), VecFromMask(d, m))); + } + + // ------------------------------ Equality +@@ -683,6 +686,14 @@ HWY_API Mask128 operator>=(co + return Mask128{_mm_cmpge_pd(a.raw, b.raw)}; + } + ++// ------------------------------ FirstN (Iota, Lt) ++ ++template ++HWY_API Mask128 FirstN(const Simd d, size_t num) { ++ const RebindToSigned di; // Signed comparisons are cheaper. ++ return RebindMask(d, Iota(di, 0) < Set(di, static_cast>(num))); ++} ++ + // ================================================== ARITHMETIC + + // ------------------------------ Addition +@@ -894,7 +905,7 @@ template + HWY_API Vec128 Abs(const Vec128 v) { + return Vec128{_mm_abs_epi32(v.raw)}; + } +- ++// i64 is implemented after BroadcastSignBit. + template + HWY_API Vec128 Abs(const Vec128 v) { + const Vec128 mask{_mm_set1_epi32(0x7FFFFFFF)}; +@@ -959,7 +970,6 @@ HWY_API Vec128 Mu + + // ------------------------------ ShiftLeft + +-// Unsigned + template + HWY_API Vec128 ShiftLeft(const Vec128 v) { + return Vec128{_mm_slli_epi16(v.raw, kBits)}; +@@ -988,6 +998,16 @@ HWY_API Vec128 ShiftLeft(con + return Vec128{_mm_slli_epi64(v.raw, kBits)}; + } + ++template ++HWY_API Vec128 ShiftLeft(const Vec128 v) { ++ const Simd d8; ++ // Use raw instead of BitCast to support N=1. ++ const Vec128 shifted{ShiftLeft(Vec128>{v.raw}).raw}; ++ return kBits == 1 ++ ? (v + v) ++ : (shifted & Set(d8, static_cast((0xFF << kBits) & 0xFF))); ++} ++ + // ------------------------------ ShiftRight + + template +@@ -1004,6 +1024,15 @@ HWY_API Vec128 ShiftRight(c + } + + template ++HWY_API Vec128 ShiftRight(const Vec128 v) { ++ const Simd d8; ++ // Use raw instead of BitCast to support N=1. ++ const Vec128 shifted{ ++ ShiftRight(Vec128{v.raw}).raw}; ++ return shifted & Set(d8, 0xFF >> kBits); ++} ++ ++template + HWY_API Vec128 ShiftRight(const Vec128 v) { + return Vec128{_mm_srai_epi16(v.raw, kBits)}; + } +@@ -1012,6 +1041,15 @@ HWY_API Vec128 ShiftRight(co + return Vec128{_mm_srai_epi32(v.raw, kBits)}; + } + ++template ++HWY_API Vec128 ShiftRight(const Vec128 v) { ++ const Simd di; ++ const Simd du; ++ const auto shifted = BitCast(di, ShiftRight(BitCast(du, v))); ++ const auto shifted_sign = BitCast(di, Set(du, 0x80 >> kBits)); ++ return (shifted ^ shifted_sign) - shifted_sign; ++} ++ + // i64 is implemented after BroadcastSignBit. + + // ------------------------------ BroadcastSignBit (ShiftRight, compare, mask) +@@ -1039,15 +1077,24 @@ HWY_API Vec128 BroadcastSign + return VecFromMask(v < Zero(Simd())); + #else + // Efficient Gt() requires SSE4.2 but we only have SSE4.1. BLENDVPD requires +- // two constants and domain crossing. 32-bit compare only requires Zero() +- // plus a shuffle to replicate the upper 32 bits. ++ // two constants and domain crossing. 32-bit shift avoids generating a zero. + const Simd d32; +- const auto sign = BitCast(d32, v) < Zero(d32); ++ const auto sign = ShiftRight<31>(BitCast(d32, v)); + return Vec128{ + _mm_shuffle_epi32(sign.raw, _MM_SHUFFLE(3, 3, 1, 1))}; + #endif + } + ++template ++HWY_API Vec128 Abs(const Vec128 v) { ++#if HWY_TARGET == HWY_AVX3 ++ return Vec128{_mm_abs_epi64(v.raw)}; ++#else ++ const auto zero = Zero(Simd()); ++ return IfThenElse(MaskFromVec(BroadcastSignBit(v)), zero - v, v); ++#endif ++} ++ + template + HWY_API Vec128 ShiftRight(const Vec128 v) { + #if HWY_TARGET == HWY_AVX3 +@@ -1097,6 +1144,15 @@ HWY_API Vec128 ShiftLeftSame + return Vec128{_mm_sll_epi64(v.raw, _mm_cvtsi32_si128(bits))}; + } + ++template ++HWY_API Vec128 ShiftLeftSame(const Vec128 v, const int bits) { ++ const Simd d8; ++ // Use raw instead of BitCast to support N=1. ++ const Vec128 shifted{ ++ ShiftLeftSame(Vec128>{v.raw}, bits).raw}; ++ return shifted & Set(d8, (0xFF << bits) & 0xFF); ++} ++ + // ------------------------------ ShiftRightSame (BroadcastSignBit) + + template +@@ -1116,6 +1172,16 @@ HWY_API Vec128 ShiftRightSa + } + + template ++HWY_API Vec128 ShiftRightSame(Vec128 v, ++ const int bits) { ++ const Simd d8; ++ // Use raw instead of BitCast to support N=1. ++ const Vec128 shifted{ ++ ShiftRightSame(Vec128{v.raw}, bits).raw}; ++ return shifted & Set(d8, 0xFF >> bits); ++} ++ ++template + HWY_API Vec128 ShiftRightSame(const Vec128 v, + const int bits) { + return Vec128{_mm_sra_epi16(v.raw, _mm_cvtsi32_si128(bits))}; +@@ -1140,6 +1206,15 @@ HWY_API Vec128 ShiftRightSam + #endif + } + ++template ++HWY_API Vec128 ShiftRightSame(Vec128 v, const int bits) { ++ const Simd di; ++ const Simd du; ++ const auto shifted = BitCast(di, ShiftRightSame(BitCast(du, v), bits)); ++ const auto shifted_sign = BitCast(di, Set(du, 0x80 >> bits)); ++ return (shifted ^ shifted_sign) - shifted_sign; ++} ++ + // ------------------------------ Negate + + template +@@ -1729,32 +1804,196 @@ HWY_API void Stream(const Vec128 ++HWY_API void ScatterOffset(hwy::SizeTag<4> /* tag */, Vec128 v, ++ Simd /* tag */, T* HWY_RESTRICT base, ++ const Vec128 offset) { ++ if (N == 4) { ++ _mm_i32scatter_epi32(base, offset.raw, v.raw, 1); ++ } else { ++ const __mmask8 mask = (1u << N) - 1; ++ _mm_mask_i32scatter_epi32(base, mask, offset.raw, v.raw, 1); ++ } ++} ++template ++HWY_API void ScatterIndex(hwy::SizeTag<4> /* tag */, Vec128 v, ++ Simd /* tag */, T* HWY_RESTRICT base, ++ const Vec128 index) { ++ if (N == 4) { ++ _mm_i32scatter_epi32(base, index.raw, v.raw, 4); ++ } else { ++ const __mmask8 mask = (1u << N) - 1; ++ _mm_mask_i32scatter_epi32(base, mask, index.raw, v.raw, 4); ++ } ++} ++ ++template ++HWY_API void ScatterOffset(hwy::SizeTag<8> /* tag */, Vec128 v, ++ Simd /* tag */, T* HWY_RESTRICT base, ++ const Vec128 offset) { ++ if (N == 2) { ++ _mm_i64scatter_epi64(base, offset.raw, v.raw, 1); ++ } else { ++ const __mmask8 mask = (1u << N) - 1; ++ _mm_mask_i64scatter_epi64(base, mask, offset.raw, v.raw, 1); ++ } ++} ++template ++HWY_API void ScatterIndex(hwy::SizeTag<8> /* tag */, Vec128 v, ++ Simd /* tag */, T* HWY_RESTRICT base, ++ const Vec128 index) { ++ if (N == 2) { ++ _mm_i64scatter_epi64(base, index.raw, v.raw, 8); ++ } else { ++ const __mmask8 mask = (1u << N) - 1; ++ _mm_mask_i64scatter_epi64(base, mask, index.raw, v.raw, 8); ++ } ++} ++ ++} // namespace detail ++ ++template ++HWY_API void ScatterOffset(Vec128 v, Simd d, T* HWY_RESTRICT base, ++ const Vec128 offset) { ++ static_assert(sizeof(T) == sizeof(Offset), "Must match for portability"); ++ return detail::ScatterOffset(hwy::SizeTag(), v, d, base, offset); ++} ++template ++HWY_API void ScatterIndex(Vec128 v, Simd d, T* HWY_RESTRICT base, ++ const Vec128 index) { ++ static_assert(sizeof(T) == sizeof(Index), "Must match for portability"); ++ return detail::ScatterIndex(hwy::SizeTag(), v, d, base, index); ++} ++ ++template ++HWY_INLINE void ScatterOffset(Vec128 v, Simd /* tag */, ++ float* HWY_RESTRICT base, ++ const Vec128 offset) { ++ if (N == 4) { ++ _mm_i32scatter_ps(base, offset.raw, v.raw, 1); ++ } else { ++ const __mmask8 mask = (1u << N) - 1; ++ _mm_mask_i32scatter_ps(base, mask, offset.raw, v.raw, 1); ++ } ++} ++template ++HWY_INLINE void ScatterIndex(Vec128 v, Simd /* tag */, ++ float* HWY_RESTRICT base, ++ const Vec128 index) { ++ if (N == 4) { ++ _mm_i32scatter_ps(base, index.raw, v.raw, 4); ++ } else { ++ const __mmask8 mask = (1u << N) - 1; ++ _mm_mask_i32scatter_ps(base, mask, index.raw, v.raw, 4); ++ } ++} ++ ++template ++HWY_INLINE void ScatterOffset(Vec128 v, Simd /* tag */, ++ double* HWY_RESTRICT base, ++ const Vec128 offset) { ++ if (N == 2) { ++ _mm_i64scatter_pd(base, offset.raw, v.raw, 1); ++ } else { ++ const __mmask8 mask = (1u << N) - 1; ++ _mm_mask_i64scatter_pd(base, mask, offset.raw, v.raw, 1); ++ } ++} ++template ++HWY_INLINE void ScatterIndex(Vec128 v, Simd /* tag */, ++ double* HWY_RESTRICT base, ++ const Vec128 index) { ++ if (N == 2) { ++ _mm_i64scatter_pd(base, index.raw, v.raw, 8); ++ } else { ++ const __mmask8 mask = (1u << N) - 1; ++ _mm_mask_i64scatter_pd(base, mask, index.raw, v.raw, 8); ++ } ++} ++#else // HWY_TARGET == HWY_AVX3 ++ ++template ++HWY_API void ScatterOffset(Vec128 v, Simd d, T* HWY_RESTRICT base, ++ const Vec128 offset) { ++ static_assert(sizeof(T) == sizeof(Offset), "Must match for portability"); ++ ++ alignas(16) T lanes[N]; ++ Store(v, d, lanes); ++ ++ alignas(16) Offset offset_lanes[N]; ++ Store(offset, Simd(), offset_lanes); ++ ++ uint8_t* base_bytes = reinterpret_cast(base); ++ for (size_t i = 0; i < N; ++i) { ++ CopyBytes(&lanes[i], base_bytes + offset_lanes[i]); ++ } ++} ++ ++template ++HWY_API void ScatterIndex(Vec128 v, Simd d, T* HWY_RESTRICT base, ++ const Vec128 index) { ++ static_assert(sizeof(T) == sizeof(Index), "Must match for portability"); ++ ++ alignas(16) T lanes[N]; ++ Store(v, d, lanes); ++ ++ alignas(16) Index index_lanes[N]; ++ Store(index, Simd(), index_lanes); ++ ++ for (size_t i = 0; i < N; ++i) { ++ base[index_lanes[i]] = lanes[i]; ++ } ++} ++ ++#endif ++ ++// ------------------------------ Gather (Load/Store) ++ + #if HWY_TARGET == HWY_SSE4 + + template + HWY_API Vec128 GatherOffset(const Simd d, + const T* HWY_RESTRICT base, + const Vec128 offset) { +- static_assert(N == 1, "SSE4 does not support full gather"); +- static_assert(sizeof(T) == sizeof(Offset), "T must match Offset"); +- const uintptr_t address = reinterpret_cast(base) + GetLane(offset); +- T val; +- CopyBytes(reinterpret_cast(address), &val); +- return Set(d, val); ++ static_assert(sizeof(T) == sizeof(Offset), "Must match for portability"); ++ ++ alignas(16) Offset offset_lanes[N]; ++ Store(offset, Simd(), offset_lanes); ++ ++ alignas(16) T lanes[N]; ++ const uint8_t* base_bytes = reinterpret_cast(base); ++ for (size_t i = 0; i < N; ++i) { ++ CopyBytes(base_bytes + offset_lanes[i], &lanes[i]); ++ } ++ return Load(d, lanes); + } + + template + HWY_API Vec128 GatherIndex(const Simd d, const T* HWY_RESTRICT base, + const Vec128 index) { +- static_assert(N == 1, "SSE4 does not support full gather"); +- static_assert(sizeof(T) == sizeof(Index), "T must match Index"); +- return Set(d, base[GetLane(index)]); ++ static_assert(sizeof(T) == sizeof(Index), "Must match for portability"); ++ ++ alignas(16) Index index_lanes[N]; ++ Store(index, Simd(), index_lanes); ++ ++ alignas(16) T lanes[N]; ++ for (size_t i = 0; i < N; ++i) { ++ lanes[i] = base[index_lanes[i]]; ++ } ++ return Load(d, lanes); + } + + #else +@@ -1832,6 +2071,8 @@ HWY_API Vec128 GatherIndex(Si + + #endif // HWY_TARGET != HWY_SSE4 + ++HWY_DIAGNOSTICS(pop) ++ + // ================================================== SWIZZLE + + // ------------------------------ Extract half +@@ -1859,10 +2100,10 @@ HWY_INLINE Vec128 UpperHalf(V + // ------------------------------ Shift vector by constant #bytes + + // 0x01..0F, kBytes = 1 => 0x02..0F00 +-template +-HWY_API Vec128 ShiftLeftBytes(const Vec128 v) { ++template ++HWY_API Vec128 ShiftLeftBytes(const Vec128 v) { + static_assert(0 <= kBytes && kBytes <= 16, "Invalid kBytes"); +- return Vec128{_mm_slli_si128(v.raw, kBytes)}; ++ return Vec128{_mm_slli_si128(v.raw, kBytes)}; + } + + template +@@ -1873,10 +2114,10 @@ HWY_API Vec128 ShiftLeftLanes(cons + } + + // 0x01..0F, kBytes = 1 => 0x0001..0E +-template +-HWY_API Vec128 ShiftRightBytes(const Vec128 v) { ++template ++HWY_API Vec128 ShiftRightBytes(const Vec128 v) { + static_assert(0 <= kBytes && kBytes <= 16, "Invalid kBytes"); +- return Vec128{_mm_srli_si128(v.raw, kBytes)}; ++ return Vec128{_mm_srli_si128(v.raw, kBytes)}; + } + + template +@@ -2041,44 +2282,47 @@ HWY_API Vec128 Shuffle0123(const + // ------------------------------ TableLookupLanes + + // Returned by SetTableIndices for use by TableLookupLanes. +-template ++template + struct Indices128 { + __m128i raw; + }; + +-template +-HWY_API Indices128 SetTableIndices(Full128, const int32_t* idx) { ++template ++HWY_API Indices128 SetTableIndices(Simd d, const int32_t* idx) { + #if !defined(NDEBUG) || defined(ADDRESS_SANITIZER) +- const size_t N = 16 / sizeof(T); + for (size_t i = 0; i < N; ++i) { + HWY_DASSERT(0 <= idx[i] && idx[i] < static_cast(N)); + } + #endif + +- const Full128 d8; +- alignas(16) uint8_t control[16]; +- for (size_t idx_byte = 0; idx_byte < 16; ++idx_byte) { +- const size_t idx_lane = idx_byte / sizeof(T); +- const size_t mod = idx_byte % sizeof(T); +- control[idx_byte] = static_cast(idx[idx_lane] * sizeof(T) + mod); ++ const Repartition d8; ++ alignas(16) uint8_t control[16] = {0}; ++ for (size_t idx_lane = 0; idx_lane < N; ++idx_lane) { ++ for (size_t idx_byte = 0; idx_byte < sizeof(T); ++idx_byte) { ++ control[idx_lane * sizeof(T) + idx_byte] = ++ static_cast(idx[idx_lane] * sizeof(T) + idx_byte); ++ } + } +- return Indices128{Load(d8, control).raw}; ++ return Indices128{Load(d8, control).raw}; + } + +-HWY_API Vec128 TableLookupLanes(const Vec128 v, +- const Indices128 idx) { +- return TableLookupBytes(v, Vec128{idx.raw}); ++template ++HWY_API Vec128 TableLookupLanes( ++ const Vec128 v, const Indices128 idx) { ++ return TableLookupBytes(v, Vec128{idx.raw}); + } +-HWY_API Vec128 TableLookupLanes(const Vec128 v, +- const Indices128 idx) { +- return TableLookupBytes(v, Vec128{idx.raw}); ++template ++HWY_API Vec128 TableLookupLanes(const Vec128 v, ++ const Indices128 idx) { ++ return TableLookupBytes(v, Vec128{idx.raw}); + } +-HWY_API Vec128 TableLookupLanes(const Vec128 v, +- const Indices128 idx) { +- const Full128 di; +- const Full128 df; ++template ++HWY_API Vec128 TableLookupLanes(const Vec128 v, ++ const Indices128 idx) { ++ const Simd di; ++ const Simd df; + return BitCast(df, +- TableLookupBytes(BitCast(di, v), Vec128{idx.raw})); ++ TableLookupBytes(BitCast(di, v), Vec128{idx.raw})); + } + + // ------------------------------ Interleave lanes +@@ -2286,47 +2530,47 @@ HWY_INLINE Vec128 ConcatUpperLow + + namespace detail { + +-template +-HWY_API Vec128 OddEven(hwy::SizeTag<1> /* tag */, const Vec128 a, +- const Vec128 b) { +- const Full128 d; +- const Full128 d8; ++template ++HWY_API Vec128 OddEven(hwy::SizeTag<1> /* tag */, const Vec128 a, ++ const Vec128 b) { ++ const Simd d; ++ const Repartition d8; + alignas(16) constexpr uint8_t mask[16] = {0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, + 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0}; + return IfThenElse(MaskFromVec(BitCast(d, Load(d8, mask))), b, a); + } +-template +-HWY_API Vec128 OddEven(hwy::SizeTag<2> /* tag */, const Vec128 a, +- const Vec128 b) { +- return Vec128{_mm_blend_epi16(a.raw, b.raw, 0x55)}; ++template ++HWY_API Vec128 OddEven(hwy::SizeTag<2> /* tag */, const Vec128 a, ++ const Vec128 b) { ++ return Vec128{_mm_blend_epi16(a.raw, b.raw, 0x55)}; + } +-template +-HWY_API Vec128 OddEven(hwy::SizeTag<4> /* tag */, const Vec128 a, +- const Vec128 b) { +- return Vec128{_mm_blend_epi16(a.raw, b.raw, 0x33)}; ++template ++HWY_API Vec128 OddEven(hwy::SizeTag<4> /* tag */, const Vec128 a, ++ const Vec128 b) { ++ return Vec128{_mm_blend_epi16(a.raw, b.raw, 0x33)}; + } +-template +-HWY_API Vec128 OddEven(hwy::SizeTag<8> /* tag */, const Vec128 a, +- const Vec128 b) { +- return Vec128{_mm_blend_epi16(a.raw, b.raw, 0x0F)}; ++template ++HWY_API Vec128 OddEven(hwy::SizeTag<8> /* tag */, const Vec128 a, ++ const Vec128 b) { ++ return Vec128{_mm_blend_epi16(a.raw, b.raw, 0x0F)}; + } + + } // namespace detail + +-template +-HWY_API Vec128 OddEven(const Vec128 a, const Vec128 b) { ++template ++HWY_API Vec128 OddEven(const Vec128 a, const Vec128 b) { + return detail::OddEven(hwy::SizeTag(), a, b); + } +-template <> +-HWY_INLINE Vec128 OddEven(const Vec128 a, +- const Vec128 b) { +- return Vec128{_mm_blend_ps(a.raw, b.raw, 5)}; ++template ++HWY_INLINE Vec128 OddEven(const Vec128 a, ++ const Vec128 b) { ++ return Vec128{_mm_blend_ps(a.raw, b.raw, 5)}; + } + +-template <> +-HWY_INLINE Vec128 OddEven(const Vec128 a, +- const Vec128 b) { +- return Vec128{_mm_blend_pd(a.raw, b.raw, 1)}; ++template ++HWY_INLINE Vec128 OddEven(const Vec128 a, ++ const Vec128 b) { ++ return Vec128{_mm_blend_pd(a.raw, b.raw, 1)}; + } + + // ------------------------------ Shl (ZipLower, Mul) +@@ -2764,7 +3008,7 @@ HWY_API Vec128 U8FromU32(con + return LowerHalf(LowerHalf(BitCast(d8, quad))); + } + +-// ------------------------------ Convert integer <=> floating point ++// ------------------------------ Integer <=> fp (ShiftRight, OddEven) + + template + HWY_API Vec128 ConvertTo(Simd /* tag */, +@@ -2779,13 +3023,20 @@ HWY_API Vec128 ConvertTo(Simd + (void)dd; + return Vec128{_mm_cvtepi64_pd(v.raw)}; + #else +- alignas(16) int64_t lanes_i[2]; +- Store(v, Simd(), lanes_i); +- alignas(16) double lanes_d[2]; +- for (size_t i = 0; i < N; ++i) { +- lanes_d[i] = static_cast(lanes_i[i]); +- } +- return Load(dd, lanes_d); ++ // Based on wim's approach (https://stackoverflow.com/questions/41144668/) ++ const Repartition d32; ++ const Repartition d64; ++ ++ // Toggle MSB of lower 32-bits and insert exponent for 2^84 + 2^63 ++ const auto k84_63 = Set(d64, 0x4530000080000000ULL); ++ const auto v_upper = BitCast(dd, ShiftRight<32>(BitCast(d64, v)) ^ k84_63); ++ ++ // Exponent is 2^52, lower 32 bits from v (=> 32-bit OddEven) ++ const auto k52 = Set(d32, 0x43300000); ++ const auto v_lower = BitCast(dd, OddEven(k52, BitCast(d32, v))); ++ ++ const auto k84_63_52 = BitCast(dd, Set(d64, 0x4530000080100000ULL)); ++ return (v_upper - k84_63_52) + v_lower; // order matters! + #endif + } + +@@ -2922,6 +3173,142 @@ HWY_API size_t CountTrue(const Mask128 ++HWY_INLINE Vec128 Idx16x8FromBits(const uint64_t mask_bits) { ++ HWY_DASSERT(mask_bits < 256); ++ const Simd d; ++ const Rebind d8; ++ const Simd du; ++ ++ // compress_epi16 requires VBMI2 and there is no permutevar_epi16, so we need ++ // byte indices for PSHUFB (one vector's worth for each of 256 combinations of ++ // 8 mask bits). Loading them directly would require 4 KiB. We can instead ++ // store lane indices and convert to byte indices (2*lane + 0..1), with the ++ // doubling baked into the table. AVX2 Compress32 stores eight 4-bit lane ++ // indices (total 1 KiB), broadcasts them into each 32-bit lane and shifts. ++ // Here, 16-bit lanes are too narrow to hold all bits, and unpacking nibbles ++ // is likely more costly than the higher cache footprint from storing bytes. ++ alignas(16) constexpr uint8_t table[256 * 8] = { ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, ++ 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, ++ 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, ++ 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, ++ 0, 6, 0, 0, 0, 0, 0, 0, 2, 6, 0, 0, 0, 0, 0, 0, 0, 2, ++ 6, 0, 0, 0, 0, 0, 4, 6, 0, 0, 0, 0, 0, 0, 0, 4, 6, 0, ++ 0, 0, 0, 0, 2, 4, 6, 0, 0, 0, 0, 0, 0, 2, 4, 6, 0, 0, ++ 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, ++ 2, 8, 0, 0, 0, 0, 0, 0, 0, 2, 8, 0, 0, 0, 0, 0, 4, 8, ++ 0, 0, 0, 0, 0, 0, 0, 4, 8, 0, 0, 0, 0, 0, 2, 4, 8, 0, ++ 0, 0, 0, 0, 0, 2, 4, 8, 0, 0, 0, 0, 6, 8, 0, 0, 0, 0, ++ 0, 0, 0, 6, 8, 0, 0, 0, 0, 0, 2, 6, 8, 0, 0, 0, 0, 0, ++ 0, 2, 6, 8, 0, 0, 0, 0, 4, 6, 8, 0, 0, 0, 0, 0, 0, 4, ++ 6, 8, 0, 0, 0, 0, 2, 4, 6, 8, 0, 0, 0, 0, 0, 2, 4, 6, ++ 8, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, ++ 0, 0, 2, 10, 0, 0, 0, 0, 0, 0, 0, 2, 10, 0, 0, 0, 0, 0, ++ 4, 10, 0, 0, 0, 0, 0, 0, 0, 4, 10, 0, 0, 0, 0, 0, 2, 4, ++ 10, 0, 0, 0, 0, 0, 0, 2, 4, 10, 0, 0, 0, 0, 6, 10, 0, 0, ++ 0, 0, 0, 0, 0, 6, 10, 0, 0, 0, 0, 0, 2, 6, 10, 0, 0, 0, ++ 0, 0, 0, 2, 6, 10, 0, 0, 0, 0, 4, 6, 10, 0, 0, 0, 0, 0, ++ 0, 4, 6, 10, 0, 0, 0, 0, 2, 4, 6, 10, 0, 0, 0, 0, 0, 2, ++ 4, 6, 10, 0, 0, 0, 8, 10, 0, 0, 0, 0, 0, 0, 0, 8, 10, 0, ++ 0, 0, 0, 0, 2, 8, 10, 0, 0, 0, 0, 0, 0, 2, 8, 10, 0, 0, ++ 0, 0, 4, 8, 10, 0, 0, 0, 0, 0, 0, 4, 8, 10, 0, 0, 0, 0, ++ 2, 4, 8, 10, 0, 0, 0, 0, 0, 2, 4, 8, 10, 0, 0, 0, 6, 8, ++ 10, 0, 0, 0, 0, 0, 0, 6, 8, 10, 0, 0, 0, 0, 2, 6, 8, 10, ++ 0, 0, 0, 0, 0, 2, 6, 8, 10, 0, 0, 0, 4, 6, 8, 10, 0, 0, ++ 0, 0, 0, 4, 6, 8, 10, 0, 0, 0, 2, 4, 6, 8, 10, 0, 0, 0, ++ 0, 2, 4, 6, 8, 10, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 12, ++ 0, 0, 0, 0, 0, 0, 2, 12, 0, 0, 0, 0, 0, 0, 0, 2, 12, 0, ++ 0, 0, 0, 0, 4, 12, 0, 0, 0, 0, 0, 0, 0, 4, 12, 0, 0, 0, ++ 0, 0, 2, 4, 12, 0, 0, 0, 0, 0, 0, 2, 4, 12, 0, 0, 0, 0, ++ 6, 12, 0, 0, 0, 0, 0, 0, 0, 6, 12, 0, 0, 0, 0, 0, 2, 6, ++ 12, 0, 0, 0, 0, 0, 0, 2, 6, 12, 0, 0, 0, 0, 4, 6, 12, 0, ++ 0, 0, 0, 0, 0, 4, 6, 12, 0, 0, 0, 0, 2, 4, 6, 12, 0, 0, ++ 0, 0, 0, 2, 4, 6, 12, 0, 0, 0, 8, 12, 0, 0, 0, 0, 0, 0, ++ 0, 8, 12, 0, 0, 0, 0, 0, 2, 8, 12, 0, 0, 0, 0, 0, 0, 2, ++ 8, 12, 0, 0, 0, 0, 4, 8, 12, 0, 0, 0, 0, 0, 0, 4, 8, 12, ++ 0, 0, 0, 0, 2, 4, 8, 12, 0, 0, 0, 0, 0, 2, 4, 8, 12, 0, ++ 0, 0, 6, 8, 12, 0, 0, 0, 0, 0, 0, 6, 8, 12, 0, 0, 0, 0, ++ 2, 6, 8, 12, 0, 0, 0, 0, 0, 2, 6, 8, 12, 0, 0, 0, 4, 6, ++ 8, 12, 0, 0, 0, 0, 0, 4, 6, 8, 12, 0, 0, 0, 2, 4, 6, 8, ++ 12, 0, 0, 0, 0, 2, 4, 6, 8, 12, 0, 0, 10, 12, 0, 0, 0, 0, ++ 0, 0, 0, 10, 12, 0, 0, 0, 0, 0, 2, 10, 12, 0, 0, 0, 0, 0, ++ 0, 2, 10, 12, 0, 0, 0, 0, 4, 10, 12, 0, 0, 0, 0, 0, 0, 4, ++ 10, 12, 0, 0, 0, 0, 2, 4, 10, 12, 0, 0, 0, 0, 0, 2, 4, 10, ++ 12, 0, 0, 0, 6, 10, 12, 0, 0, 0, 0, 0, 0, 6, 10, 12, 0, 0, ++ 0, 0, 2, 6, 10, 12, 0, 0, 0, 0, 0, 2, 6, 10, 12, 0, 0, 0, ++ 4, 6, 10, 12, 0, 0, 0, 0, 0, 4, 6, 10, 12, 0, 0, 0, 2, 4, ++ 6, 10, 12, 0, 0, 0, 0, 2, 4, 6, 10, 12, 0, 0, 8, 10, 12, 0, ++ 0, 0, 0, 0, 0, 8, 10, 12, 0, 0, 0, 0, 2, 8, 10, 12, 0, 0, ++ 0, 0, 0, 2, 8, 10, 12, 0, 0, 0, 4, 8, 10, 12, 0, 0, 0, 0, ++ 0, 4, 8, 10, 12, 0, 0, 0, 2, 4, 8, 10, 12, 0, 0, 0, 0, 2, ++ 4, 8, 10, 12, 0, 0, 6, 8, 10, 12, 0, 0, 0, 0, 0, 6, 8, 10, ++ 12, 0, 0, 0, 2, 6, 8, 10, 12, 0, 0, 0, 0, 2, 6, 8, 10, 12, ++ 0, 0, 4, 6, 8, 10, 12, 0, 0, 0, 0, 4, 6, 8, 10, 12, 0, 0, ++ 2, 4, 6, 8, 10, 12, 0, 0, 0, 2, 4, 6, 8, 10, 12, 0, 14, 0, ++ 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 2, 14, 0, 0, ++ 0, 0, 0, 0, 0, 2, 14, 0, 0, 0, 0, 0, 4, 14, 0, 0, 0, 0, ++ 0, 0, 0, 4, 14, 0, 0, 0, 0, 0, 2, 4, 14, 0, 0, 0, 0, 0, ++ 0, 2, 4, 14, 0, 0, 0, 0, 6, 14, 0, 0, 0, 0, 0, 0, 0, 6, ++ 14, 0, 0, 0, 0, 0, 2, 6, 14, 0, 0, 0, 0, 0, 0, 2, 6, 14, ++ 0, 0, 0, 0, 4, 6, 14, 0, 0, 0, 0, 0, 0, 4, 6, 14, 0, 0, ++ 0, 0, 2, 4, 6, 14, 0, 0, 0, 0, 0, 2, 4, 6, 14, 0, 0, 0, ++ 8, 14, 0, 0, 0, 0, 0, 0, 0, 8, 14, 0, 0, 0, 0, 0, 2, 8, ++ 14, 0, 0, 0, 0, 0, 0, 2, 8, 14, 0, 0, 0, 0, 4, 8, 14, 0, ++ 0, 0, 0, 0, 0, 4, 8, 14, 0, 0, 0, 0, 2, 4, 8, 14, 0, 0, ++ 0, 0, 0, 2, 4, 8, 14, 0, 0, 0, 6, 8, 14, 0, 0, 0, 0, 0, ++ 0, 6, 8, 14, 0, 0, 0, 0, 2, 6, 8, 14, 0, 0, 0, 0, 0, 2, ++ 6, 8, 14, 0, 0, 0, 4, 6, 8, 14, 0, 0, 0, 0, 0, 4, 6, 8, ++ 14, 0, 0, 0, 2, 4, 6, 8, 14, 0, 0, 0, 0, 2, 4, 6, 8, 14, ++ 0, 0, 10, 14, 0, 0, 0, 0, 0, 0, 0, 10, 14, 0, 0, 0, 0, 0, ++ 2, 10, 14, 0, 0, 0, 0, 0, 0, 2, 10, 14, 0, 0, 0, 0, 4, 10, ++ 14, 0, 0, 0, 0, 0, 0, 4, 10, 14, 0, 0, 0, 0, 2, 4, 10, 14, ++ 0, 0, 0, 0, 0, 2, 4, 10, 14, 0, 0, 0, 6, 10, 14, 0, 0, 0, ++ 0, 0, 0, 6, 10, 14, 0, 0, 0, 0, 2, 6, 10, 14, 0, 0, 0, 0, ++ 0, 2, 6, 10, 14, 0, 0, 0, 4, 6, 10, 14, 0, 0, 0, 0, 0, 4, ++ 6, 10, 14, 0, 0, 0, 2, 4, 6, 10, 14, 0, 0, 0, 0, 2, 4, 6, ++ 10, 14, 0, 0, 8, 10, 14, 0, 0, 0, 0, 0, 0, 8, 10, 14, 0, 0, ++ 0, 0, 2, 8, 10, 14, 0, 0, 0, 0, 0, 2, 8, 10, 14, 0, 0, 0, ++ 4, 8, 10, 14, 0, 0, 0, 0, 0, 4, 8, 10, 14, 0, 0, 0, 2, 4, ++ 8, 10, 14, 0, 0, 0, 0, 2, 4, 8, 10, 14, 0, 0, 6, 8, 10, 14, ++ 0, 0, 0, 0, 0, 6, 8, 10, 14, 0, 0, 0, 2, 6, 8, 10, 14, 0, ++ 0, 0, 0, 2, 6, 8, 10, 14, 0, 0, 4, 6, 8, 10, 14, 0, 0, 0, ++ 0, 4, 6, 8, 10, 14, 0, 0, 2, 4, 6, 8, 10, 14, 0, 0, 0, 2, ++ 4, 6, 8, 10, 14, 0, 12, 14, 0, 0, 0, 0, 0, 0, 0, 12, 14, 0, ++ 0, 0, 0, 0, 2, 12, 14, 0, 0, 0, 0, 0, 0, 2, 12, 14, 0, 0, ++ 0, 0, 4, 12, 14, 0, 0, 0, 0, 0, 0, 4, 12, 14, 0, 0, 0, 0, ++ 2, 4, 12, 14, 0, 0, 0, 0, 0, 2, 4, 12, 14, 0, 0, 0, 6, 12, ++ 14, 0, 0, 0, 0, 0, 0, 6, 12, 14, 0, 0, 0, 0, 2, 6, 12, 14, ++ 0, 0, 0, 0, 0, 2, 6, 12, 14, 0, 0, 0, 4, 6, 12, 14, 0, 0, ++ 0, 0, 0, 4, 6, 12, 14, 0, 0, 0, 2, 4, 6, 12, 14, 0, 0, 0, ++ 0, 2, 4, 6, 12, 14, 0, 0, 8, 12, 14, 0, 0, 0, 0, 0, 0, 8, ++ 12, 14, 0, 0, 0, 0, 2, 8, 12, 14, 0, 0, 0, 0, 0, 2, 8, 12, ++ 14, 0, 0, 0, 4, 8, 12, 14, 0, 0, 0, 0, 0, 4, 8, 12, 14, 0, ++ 0, 0, 2, 4, 8, 12, 14, 0, 0, 0, 0, 2, 4, 8, 12, 14, 0, 0, ++ 6, 8, 12, 14, 0, 0, 0, 0, 0, 6, 8, 12, 14, 0, 0, 0, 2, 6, ++ 8, 12, 14, 0, 0, 0, 0, 2, 6, 8, 12, 14, 0, 0, 4, 6, 8, 12, ++ 14, 0, 0, 0, 0, 4, 6, 8, 12, 14, 0, 0, 2, 4, 6, 8, 12, 14, ++ 0, 0, 0, 2, 4, 6, 8, 12, 14, 0, 10, 12, 14, 0, 0, 0, 0, 0, ++ 0, 10, 12, 14, 0, 0, 0, 0, 2, 10, 12, 14, 0, 0, 0, 0, 0, 2, ++ 10, 12, 14, 0, 0, 0, 4, 10, 12, 14, 0, 0, 0, 0, 0, 4, 10, 12, ++ 14, 0, 0, 0, 2, 4, 10, 12, 14, 0, 0, 0, 0, 2, 4, 10, 12, 14, ++ 0, 0, 6, 10, 12, 14, 0, 0, 0, 0, 0, 6, 10, 12, 14, 0, 0, 0, ++ 2, 6, 10, 12, 14, 0, 0, 0, 0, 2, 6, 10, 12, 14, 0, 0, 4, 6, ++ 10, 12, 14, 0, 0, 0, 0, 4, 6, 10, 12, 14, 0, 0, 2, 4, 6, 10, ++ 12, 14, 0, 0, 0, 2, 4, 6, 10, 12, 14, 0, 8, 10, 12, 14, 0, 0, ++ 0, 0, 0, 8, 10, 12, 14, 0, 0, 0, 2, 8, 10, 12, 14, 0, 0, 0, ++ 0, 2, 8, 10, 12, 14, 0, 0, 4, 8, 10, 12, 14, 0, 0, 0, 0, 4, ++ 8, 10, 12, 14, 0, 0, 2, 4, 8, 10, 12, 14, 0, 0, 0, 2, 4, 8, ++ 10, 12, 14, 0, 6, 8, 10, 12, 14, 0, 0, 0, 0, 6, 8, 10, 12, 14, ++ 0, 0, 2, 6, 8, 10, 12, 14, 0, 0, 0, 2, 6, 8, 10, 12, 14, 0, ++ 4, 6, 8, 10, 12, 14, 0, 0, 0, 4, 6, 8, 10, 12, 14, 0, 2, 4, ++ 6, 8, 10, 12, 14, 0, 0, 2, 4, 6, 8, 10, 12, 14}; ++ ++ const Vec128 byte_idx{Load(d8, table + mask_bits * 8).raw}; ++ const Vec128 pairs = ZipLower(byte_idx, byte_idx); ++ return BitCast(d, pairs + Set(du, 0x0100)); ++} ++ ++template + HWY_INLINE Vec128 Idx32x4FromBits(const uint64_t mask_bits) { + HWY_DASSERT(mask_bits < 16); + +@@ -2968,71 +3355,42 @@ HWY_INLINE Vec128 Idx64x2FromBits( + // Helper function called by both Compress and CompressStore - avoids a + // redundant BitsFromMask in the latter. + +-template +-HWY_API Vec128 Compress(Vec128 v, +- const uint64_t mask_bits) { +-#if HWY_TARGET == HWY_AVX3 +- return Vec128{_mm_maskz_compress_epi32(mask_bits, v.raw)}; +-#else +- const auto idx = detail::Idx32x4FromBits(mask_bits); +- return TableLookupBytes(v, idx); +-#endif +-} +-template +-HWY_API Vec128 Compress(Vec128 v, +- const uint64_t mask_bits) { +-#if HWY_TARGET == HWY_AVX3 +- return Vec128{_mm_maskz_compress_epi32(mask_bits, v.raw)}; +-#else +- const auto idx = detail::Idx32x4FromBits(mask_bits); +- return TableLookupBytes(v, idx); +-#endif +-} +- +-template +-HWY_API Vec128 Compress(Vec128 v, +- const uint64_t mask_bits) { +-#if HWY_TARGET == HWY_AVX3 +- return Vec128{_mm_maskz_compress_epi64(mask_bits, v.raw)}; +-#else +- const auto idx = detail::Idx64x2FromBits(mask_bits); +- return TableLookupBytes(v, idx); +-#endif +-} +-template +-HWY_API Vec128 Compress(Vec128 v, +- const uint64_t mask_bits) { +-#if HWY_TARGET == HWY_AVX3 +- return Vec128{_mm_maskz_compress_epi64(mask_bits, v.raw)}; +-#else +- const auto idx = detail::Idx64x2FromBits(mask_bits); +- return TableLookupBytes(v, idx); +-#endif ++template ++HWY_API Vec128 Compress(hwy::SizeTag<2> /*tag*/, Vec128 v, ++ const uint64_t mask_bits) { ++ const auto idx = detail::Idx16x8FromBits(mask_bits); ++ using D = Simd; ++ const RebindToSigned di; ++ return BitCast(D(), TableLookupBytes(BitCast(di, v), BitCast(di, idx))); + } + +-template +-HWY_API Vec128 Compress(Vec128 v, +- const uint64_t mask_bits) { ++template ++HWY_API Vec128 Compress(hwy::SizeTag<4> /*tag*/, Vec128 v, ++ const uint64_t mask_bits) { ++ using D = Simd; ++ using TI = MakeSigned; ++ const Rebind di; + #if HWY_TARGET == HWY_AVX3 +- return Vec128{_mm_maskz_compress_ps(mask_bits, v.raw)}; ++ return BitCast(D(), Vec128{_mm_maskz_compress_epi32( ++ mask_bits, BitCast(di, v).raw)}); + #else +- const auto idx = detail::Idx32x4FromBits(mask_bits); +- const Simd df; +- const Simd di; +- return BitCast(df, TableLookupBytes(BitCast(di, v), idx)); ++ const auto idx = detail::Idx32x4FromBits(mask_bits); ++ return BitCast(D(), TableLookupBytes(BitCast(di, v), BitCast(di, idx))); + #endif + } + +-template +-HWY_API Vec128 Compress(Vec128 v, +- const uint64_t mask_bits) { ++template ++HWY_API Vec128 Compress(hwy::SizeTag<8> /*tag*/, Vec128 v, ++ const uint64_t mask_bits) { ++ using D = Simd; ++ using TI = MakeSigned; ++ const Rebind di; + #if HWY_TARGET == HWY_AVX3 +- return Vec128{_mm_maskz_compress_pd(mask_bits, v.raw)}; ++ return BitCast(D(), Vec128{_mm_maskz_compress_epi64( ++ mask_bits, BitCast(di, v).raw)}); + #else +- const auto idx = detail::Idx64x2FromBits(mask_bits); +- const Simd df; +- const Simd di; +- return BitCast(df, TableLookupBytes(BitCast(di, v), idx)); ++ const auto idx = detail::Idx64x2FromBits(mask_bits); ++ return BitCast(D(), TableLookupBytes(BitCast(di, v), BitCast(di, idx))); + #endif + } + +@@ -3040,7 +3398,8 @@ HWY_API Vec128 Compress(Vec12 + + template + HWY_API Vec128 Compress(Vec128 v, const Mask128 mask) { +- return detail::Compress(v, detail::BitsFromMask(mask)); ++ return detail::Compress(hwy::SizeTag(), v, ++ detail::BitsFromMask(mask)); + } + + // ------------------------------ CompressStore +@@ -3050,63 +3409,285 @@ HWY_API size_t CompressStore(Vec128 d, T* HWY_RESTRICT aligned) { + const uint64_t mask_bits = detail::BitsFromMask(mask); + // Avoid _mm_maskmoveu_si128 (>500 cycle latency because it bypasses caches). +- Store(detail::Compress(v, mask_bits), d, aligned); ++ Store(detail::Compress(hwy::SizeTag(), v, mask_bits), d, aligned); + return PopCount(mask_bits); + } + ++// ------------------------------ StoreInterleaved3 (CombineShiftRightBytes, ++// TableLookupBytes) ++ ++// 128 bits ++HWY_API void StoreInterleaved3(const Vec128 v0, ++ const Vec128 v1, ++ const Vec128 v2, Full128 d, ++ uint8_t* HWY_RESTRICT unaligned) { ++ const auto k5 = Set(d, 5); ++ const auto k6 = Set(d, 6); ++ ++ // Shuffle (v0,v1,v2) vector bytes to (MSB on left): r5, bgr[4:0]. ++ // 0x80 so lanes to be filled from other vectors are 0 for blending. ++ alignas(16) static constexpr uint8_t tbl_r0[16] = { ++ 0, 0x80, 0x80, 1, 0x80, 0x80, 2, 0x80, 0x80, // ++ 3, 0x80, 0x80, 4, 0x80, 0x80, 5}; ++ alignas(16) static constexpr uint8_t tbl_g0[16] = { ++ 0x80, 0, 0x80, 0x80, 1, 0x80, // ++ 0x80, 2, 0x80, 0x80, 3, 0x80, 0x80, 4, 0x80, 0x80}; ++ const auto shuf_r0 = Load(d, tbl_r0); ++ const auto shuf_g0 = Load(d, tbl_g0); // cannot reuse r0 due to 5 in MSB ++ const auto shuf_b0 = CombineShiftRightBytes<15>(shuf_g0, shuf_g0); ++ const auto r0 = TableLookupBytes(v0, shuf_r0); // 5..4..3..2..1..0 ++ const auto g0 = TableLookupBytes(v1, shuf_g0); // ..4..3..2..1..0. ++ const auto b0 = TableLookupBytes(v2, shuf_b0); // .4..3..2..1..0.. ++ const auto int0 = r0 | g0 | b0; ++ StoreU(int0, d, unaligned + 0 * 16); ++ ++ // Second vector: g10,r10, bgr[9:6], b5,g5 ++ const auto shuf_r1 = shuf_b0 + k6; // .A..9..8..7..6.. ++ const auto shuf_g1 = shuf_r0 + k5; // A..9..8..7..6..5 ++ const auto shuf_b1 = shuf_g0 + k5; // ..9..8..7..6..5. ++ const auto r1 = TableLookupBytes(v0, shuf_r1); ++ const auto g1 = TableLookupBytes(v1, shuf_g1); ++ const auto b1 = TableLookupBytes(v2, shuf_b1); ++ const auto int1 = r1 | g1 | b1; ++ StoreU(int1, d, unaligned + 1 * 16); ++ ++ // Third vector: bgr[15:11], b10 ++ const auto shuf_r2 = shuf_b1 + k6; // ..F..E..D..C..B. ++ const auto shuf_g2 = shuf_r1 + k5; // .F..E..D..C..B.. ++ const auto shuf_b2 = shuf_g1 + k5; // F..E..D..C..B..A ++ const auto r2 = TableLookupBytes(v0, shuf_r2); ++ const auto g2 = TableLookupBytes(v1, shuf_g2); ++ const auto b2 = TableLookupBytes(v2, shuf_b2); ++ const auto int2 = r2 | g2 | b2; ++ StoreU(int2, d, unaligned + 2 * 16); ++} ++ ++// 64 bits ++HWY_API void StoreInterleaved3(const Vec128 v0, ++ const Vec128 v1, ++ const Vec128 v2, Simd d, ++ uint8_t* HWY_RESTRICT unaligned) { ++ // Use full vectors for the shuffles and first result. ++ const Full128 d_full; ++ const auto k5 = Set(d_full, 5); ++ const auto k6 = Set(d_full, 6); ++ ++ const Vec128 full_a{v0.raw}; ++ const Vec128 full_b{v1.raw}; ++ const Vec128 full_c{v2.raw}; ++ ++ // Shuffle (v0,v1,v2) vector bytes to (MSB on left): r5, bgr[4:0]. ++ // 0x80 so lanes to be filled from other vectors are 0 for blending. ++ alignas(16) static constexpr uint8_t tbl_r0[16] = { ++ 0, 0x80, 0x80, 1, 0x80, 0x80, 2, 0x80, 0x80, // ++ 3, 0x80, 0x80, 4, 0x80, 0x80, 5}; ++ alignas(16) static constexpr uint8_t tbl_g0[16] = { ++ 0x80, 0, 0x80, 0x80, 1, 0x80, // ++ 0x80, 2, 0x80, 0x80, 3, 0x80, 0x80, 4, 0x80, 0x80}; ++ const auto shuf_r0 = Load(d_full, tbl_r0); ++ const auto shuf_g0 = Load(d_full, tbl_g0); // cannot reuse r0 due to 5 in MSB ++ const auto shuf_b0 = CombineShiftRightBytes<15>(shuf_g0, shuf_g0); ++ const auto r0 = TableLookupBytes(full_a, shuf_r0); // 5..4..3..2..1..0 ++ const auto g0 = TableLookupBytes(full_b, shuf_g0); // ..4..3..2..1..0. ++ const auto b0 = TableLookupBytes(full_c, shuf_b0); // .4..3..2..1..0.. ++ const auto int0 = r0 | g0 | b0; ++ StoreU(int0, d_full, unaligned + 0 * 16); ++ ++ // Second (HALF) vector: bgr[7:6], b5,g5 ++ const auto shuf_r1 = shuf_b0 + k6; // ..7..6.. ++ const auto shuf_g1 = shuf_r0 + k5; // .7..6..5 ++ const auto shuf_b1 = shuf_g0 + k5; // 7..6..5. ++ const auto r1 = TableLookupBytes(full_a, shuf_r1); ++ const auto g1 = TableLookupBytes(full_b, shuf_g1); ++ const auto b1 = TableLookupBytes(full_c, shuf_b1); ++ const decltype(Zero(d)) int1{(r1 | g1 | b1).raw}; ++ StoreU(int1, d, unaligned + 1 * 16); ++} ++ ++// <= 32 bits ++template ++HWY_API void StoreInterleaved3(const Vec128 v0, ++ const Vec128 v1, ++ const Vec128 v2, ++ Simd /*tag*/, ++ uint8_t* HWY_RESTRICT unaligned) { ++ // Use full vectors for the shuffles and result. ++ const Full128 d_full; ++ ++ const Vec128 full_a{v0.raw}; ++ const Vec128 full_b{v1.raw}; ++ const Vec128 full_c{v2.raw}; ++ ++ // Shuffle (v0,v1,v2) vector bytes to bgr[3:0]. ++ // 0x80 so lanes to be filled from other vectors are 0 for blending. ++ alignas(16) static constexpr uint8_t tbl_r0[16] = { ++ 0, 0x80, 0x80, 1, 0x80, 0x80, 2, 0x80, 0x80, 3, 0x80, 0x80, // ++ 0x80, 0x80, 0x80, 0x80}; ++ const auto shuf_r0 = Load(d_full, tbl_r0); ++ const auto shuf_g0 = CombineShiftRightBytes<15>(shuf_r0, shuf_r0); ++ const auto shuf_b0 = CombineShiftRightBytes<14>(shuf_r0, shuf_r0); ++ const auto r0 = TableLookupBytes(full_a, shuf_r0); // ......3..2..1..0 ++ const auto g0 = TableLookupBytes(full_b, shuf_g0); // .....3..2..1..0. ++ const auto b0 = TableLookupBytes(full_c, shuf_b0); // ....3..2..1..0.. ++ const auto int0 = r0 | g0 | b0; ++ alignas(16) uint8_t buf[16]; ++ StoreU(int0, d_full, buf); ++ CopyBytes(buf, unaligned); ++} ++ ++// ------------------------------ StoreInterleaved4 ++ ++// 128 bits ++HWY_API void StoreInterleaved4(const Vec128 v0, ++ const Vec128 v1, ++ const Vec128 v2, ++ const Vec128 v3, Full128 d, ++ uint8_t* HWY_RESTRICT unaligned) { ++ // let a,b,c,d denote v0..3. ++ const auto ba0 = ZipLower(v0, v1); // b7 a7 .. b0 a0 ++ const auto dc0 = ZipLower(v2, v3); // d7 c7 .. d0 c0 ++ const auto ba8 = ZipUpper(v0, v1); ++ const auto dc8 = ZipUpper(v2, v3); ++ const auto dcba_0 = ZipLower(ba0, dc0); // d..a3 d..a0 ++ const auto dcba_4 = ZipUpper(ba0, dc0); // d..a7 d..a4 ++ const auto dcba_8 = ZipLower(ba8, dc8); // d..aB d..a8 ++ const auto dcba_C = ZipUpper(ba8, dc8); // d..aF d..aC ++ StoreU(BitCast(d, dcba_0), d, unaligned + 0 * 16); ++ StoreU(BitCast(d, dcba_4), d, unaligned + 1 * 16); ++ StoreU(BitCast(d, dcba_8), d, unaligned + 2 * 16); ++ StoreU(BitCast(d, dcba_C), d, unaligned + 3 * 16); ++} ++ ++// 64 bits ++HWY_API void StoreInterleaved4(const Vec128 in0, ++ const Vec128 in1, ++ const Vec128 in2, ++ const Vec128 in3, ++ Simd /*tag*/, ++ uint8_t* HWY_RESTRICT unaligned) { ++ // Use full vectors to reduce the number of stores. ++ const Vec128 v0{in0.raw}; ++ const Vec128 v1{in1.raw}; ++ const Vec128 v2{in2.raw}; ++ const Vec128 v3{in3.raw}; ++ // let a,b,c,d denote v0..3. ++ const auto ba0 = ZipLower(v0, v1); // b7 a7 .. b0 a0 ++ const auto dc0 = ZipLower(v2, v3); // d7 c7 .. d0 c0 ++ const auto dcba_0 = ZipLower(ba0, dc0); // d..a3 d..a0 ++ const auto dcba_4 = ZipUpper(ba0, dc0); // d..a7 d..a4 ++ const Full128 d_full; ++ StoreU(BitCast(d_full, dcba_0), d_full, unaligned + 0 * 16); ++ StoreU(BitCast(d_full, dcba_4), d_full, unaligned + 1 * 16); ++} ++ ++// <= 32 bits ++template ++HWY_API void StoreInterleaved4(const Vec128 in0, ++ const Vec128 in1, ++ const Vec128 in2, ++ const Vec128 in3, ++ Simd /*tag*/, ++ uint8_t* HWY_RESTRICT unaligned) { ++ // Use full vectors to reduce the number of stores. ++ const Vec128 v0{in0.raw}; ++ const Vec128 v1{in1.raw}; ++ const Vec128 v2{in2.raw}; ++ const Vec128 v3{in3.raw}; ++ // let a,b,c,d denote v0..3. ++ const auto ba0 = ZipLower(v0, v1); // b3 a3 .. b0 a0 ++ const auto dc0 = ZipLower(v2, v3); // d3 c3 .. d0 c0 ++ const auto dcba_0 = ZipLower(ba0, dc0); // d..a3 d..a0 ++ alignas(16) uint8_t buf[16]; ++ const Full128 d_full; ++ StoreU(BitCast(d_full, dcba_0), d_full, buf); ++ CopyBytes<4 * N>(buf, unaligned); ++} ++ + // ------------------------------ Reductions + + namespace detail { + +-// For u32/i32/f32. +-template +-HWY_API Vec128 SumOfLanes(hwy::SizeTag<4> /* tag */, +- const Vec128 v3210) { ++// N=1 for any T: no-op ++template ++HWY_API Vec128 SumOfLanes(hwy::SizeTag /* tag */, ++ const Vec128 v) { ++ return v; ++} ++template ++HWY_API Vec128 MinOfLanes(hwy::SizeTag /* tag */, ++ const Vec128 v) { ++ return v; ++} ++template ++HWY_API Vec128 MaxOfLanes(hwy::SizeTag /* tag */, ++ const Vec128 v) { ++ return v; ++} ++ ++// u32/i32/f32: ++ ++// N=2 ++template ++HWY_API Vec128 SumOfLanes(hwy::SizeTag<4> /* tag */, ++ const Vec128 v10) { ++ return v10 + Vec128{Shuffle2301(Vec128{v10.raw}).raw}; ++} ++template ++HWY_API Vec128 MinOfLanes(hwy::SizeTag<4> /* tag */, ++ const Vec128 v10) { ++ return Min(v10, Vec128{Shuffle2301(Vec128{v10.raw}).raw}); ++} ++template ++HWY_API Vec128 MaxOfLanes(hwy::SizeTag<4> /* tag */, ++ const Vec128 v10) { ++ return Max(v10, Vec128{Shuffle2301(Vec128{v10.raw}).raw}); ++} ++ ++// N=4 (full) ++template ++HWY_API Vec128 SumOfLanes(hwy::SizeTag<4> /* tag */, const Vec128 v3210) { + const Vec128 v1032 = Shuffle1032(v3210); + const Vec128 v31_20_31_20 = v3210 + v1032; + const Vec128 v20_31_20_31 = Shuffle0321(v31_20_31_20); + return v20_31_20_31 + v31_20_31_20; + } +-template +-HWY_API Vec128 MinOfLanes(hwy::SizeTag<4> /* tag */, +- const Vec128 v3210) { ++template ++HWY_API Vec128 MinOfLanes(hwy::SizeTag<4> /* tag */, const Vec128 v3210) { + const Vec128 v1032 = Shuffle1032(v3210); + const Vec128 v31_20_31_20 = Min(v3210, v1032); + const Vec128 v20_31_20_31 = Shuffle0321(v31_20_31_20); + return Min(v20_31_20_31, v31_20_31_20); + } +-template +-HWY_API Vec128 MaxOfLanes(hwy::SizeTag<4> /* tag */, +- const Vec128 v3210) { ++template ++HWY_API Vec128 MaxOfLanes(hwy::SizeTag<4> /* tag */, const Vec128 v3210) { + const Vec128 v1032 = Shuffle1032(v3210); + const Vec128 v31_20_31_20 = Max(v3210, v1032); + const Vec128 v20_31_20_31 = Shuffle0321(v31_20_31_20); + return Max(v20_31_20_31, v31_20_31_20); + } + +-// For u64/i64/f64. +-template +-HWY_API Vec128 SumOfLanes(hwy::SizeTag<8> /* tag */, +- const Vec128 v10) { ++// u64/i64/f64: ++ ++// N=2 (full) ++template ++HWY_API Vec128 SumOfLanes(hwy::SizeTag<8> /* tag */, const Vec128 v10) { + const Vec128 v01 = Shuffle01(v10); + return v10 + v01; + } +-template +-HWY_API Vec128 MinOfLanes(hwy::SizeTag<8> /* tag */, +- const Vec128 v10) { ++template ++HWY_API Vec128 MinOfLanes(hwy::SizeTag<8> /* tag */, const Vec128 v10) { + const Vec128 v01 = Shuffle01(v10); + return Min(v10, v01); + } +-template +-HWY_API Vec128 MaxOfLanes(hwy::SizeTag<8> /* tag */, +- const Vec128 v10) { ++template ++HWY_API Vec128 MaxOfLanes(hwy::SizeTag<8> /* tag */, const Vec128 v10) { + const Vec128 v01 = Shuffle01(v10); + return Max(v10, v01); + } + + } // namespace detail + +-// Supported for u/i/f 32/64. Returns the sum in each lane. ++// Supported for u/i/f 32/64. Returns the same value in each lane. + template + HWY_API Vec128 SumOfLanes(const Vec128 v) { + return detail::SumOfLanes(hwy::SizeTag(), v); +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/ops/x86_128-inl.hE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/ops/x86_128-inl.hE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/ops/x86_256-inl.h.12 chromium-91.0.4472.77/third_party/highway/src/hwy/ops/x86_256-inl.h +--- chromium-91.0.4472.77/third_party/highway/src/hwy/ops/x86_256-inl.h.12 2021-06-02 10:56:05.234904387 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/ops/x86_256-inl.h 2021-05-31 10:37:11.000000000 -0400 +@@ -20,6 +20,20 @@ + // particular, "Broadcast", pack and zip behavior may be surprising. + + #include // AVX2+ ++ ++#if defined(_MSC_VER) && defined(__clang__) ++// Including should be enough, but Clang's headers helpfully skip ++// including these headers when _MSC_VER is defined, like when using clang-cl. ++// Include these directly here. ++#include ++// avxintrin defines __m256i and must come before avx2intrin. ++#include ++#include // _pext_u64 ++#include ++#include ++#include ++#endif ++ + #include + #include + +@@ -148,23 +162,24 @@ HWY_API Vec256 Set(Full256{_mm256_set1_epi16(static_cast(t))}; // NOLINT + } + HWY_API Vec256 Set(Full256 /* tag */, const uint32_t t) { +- return Vec256{_mm256_set1_epi32(static_cast(t))}; // NOLINT ++ return Vec256{_mm256_set1_epi32(static_cast(t))}; + } + HWY_API Vec256 Set(Full256 /* tag */, const uint64_t t) { + return Vec256{ + _mm256_set1_epi64x(static_cast(t))}; // NOLINT + } + HWY_API Vec256 Set(Full256 /* tag */, const int8_t t) { +- return Vec256{_mm256_set1_epi8(t)}; ++ return Vec256{_mm256_set1_epi8(static_cast(t))}; // NOLINT + } + HWY_API Vec256 Set(Full256 /* tag */, const int16_t t) { +- return Vec256{_mm256_set1_epi16(t)}; ++ return Vec256{_mm256_set1_epi16(static_cast(t))}; // NOLINT + } + HWY_API Vec256 Set(Full256 /* tag */, const int32_t t) { + return Vec256{_mm256_set1_epi32(t)}; + } + HWY_API Vec256 Set(Full256 /* tag */, const int64_t t) { +- return Vec256{_mm256_set1_epi64x(t)}; ++ return Vec256{ ++ _mm256_set1_epi64x(static_cast(t))}; // NOLINT + } + HWY_API Vec256 Set(Full256 /* tag */, const float t) { + return Vec256{_mm256_set1_ps(t)}; +@@ -340,6 +355,8 @@ HWY_API Vec256 VecFromMask(Full256 + return Vec256{v.raw}; + } + ++// ------------------------------ IfThenElse ++ + // mask ? yes : no + template + HWY_API Vec256 IfThenElse(const Mask256 mask, const Vec256 yes, +@@ -412,9 +429,9 @@ HWY_API Mask256 Xor(const Mask256 + // Comparisons fill a lane with 1-bits if the condition is true, else 0. + + template +-HWY_API Mask256 RebindMask(Full256 /*tag*/, Mask256 m) { ++HWY_API Mask256 RebindMask(Full256 d_to, Mask256 m) { + static_assert(sizeof(TFrom) == sizeof(TTo), "Must have same size"); +- return Mask256{m.raw}; ++ return MaskFromVec(BitCast(d_to, VecFromMask(Full256(), m))); + } + + // ------------------------------ Equality +@@ -670,6 +687,14 @@ HWY_API Vec256 Max(const Vec256< + return Vec256{_mm256_max_pd(a.raw, b.raw)}; + } + ++// ------------------------------ FirstN (Iota, Lt) ++ ++template ++HWY_API Mask256 FirstN(const Full256 d, size_t n) { ++ const RebindToSigned di; // Signed comparisons are cheaper. ++ return RebindMask(d, Iota(di, 0) < Set(di, static_cast>(n))); ++} ++ + // ================================================== ARITHMETIC + + // ------------------------------ Addition +@@ -832,7 +857,13 @@ HWY_API Vec256 AverageRound(co + + // Returns absolute value, except that LimitsMin() maps to LimitsMax() + 1. + HWY_API Vec256 Abs(const Vec256 v) { ++#if HWY_COMPILER_MSVC ++ // Workaround for incorrect codegen? (wrong result) ++ const auto zero = Zero(Full256()); ++ return Vec256{_mm256_max_epi8(v.raw, (zero - v).raw)}; ++#else + return Vec256{_mm256_abs_epi8(v.raw)}; ++#endif + } + HWY_API Vec256 Abs(const Vec256 v) { + return Vec256{_mm256_abs_epi16(v.raw)}; +@@ -840,6 +871,7 @@ HWY_API Vec256 Abs(const Vec256 + HWY_API Vec256 Abs(const Vec256 v) { + return Vec256{_mm256_abs_epi32(v.raw)}; + } ++// i64 is implemented after BroadcastSignBit. + + HWY_API Vec256 Abs(const Vec256 v) { + const Vec256 mask{_mm256_set1_epi32(0x7FFFFFFF)}; +@@ -925,6 +957,16 @@ HWY_API Vec256 ShiftLeft(const + return Vec256{_mm256_slli_epi64(v.raw, kBits)}; + } + ++template ++HWY_API Vec256 ShiftLeft(const Vec256 v) { ++ const Full256 d8; ++ const RepartitionToWide d16; ++ const auto shifted = BitCast(d8, ShiftLeft(BitCast(d16, v))); ++ return kBits == 1 ++ ? (v + v) ++ : (shifted & Set(d8, static_cast((0xFF << kBits) & 0xFF))); ++} ++ + // ------------------------------ ShiftRight + + template +@@ -943,6 +985,14 @@ HWY_API Vec256 ShiftRight(cons + } + + template ++HWY_API Vec256 ShiftRight(const Vec256 v) { ++ const Full256 d8; ++ // Use raw instead of BitCast to support N=1. ++ const Vec256 shifted{ShiftRight(Vec256{v.raw}).raw}; ++ return shifted & Set(d8, 0xFF >> kBits); ++} ++ ++template + HWY_API Vec256 ShiftRight(const Vec256 v) { + return Vec256{_mm256_srai_epi16(v.raw, kBits)}; + } +@@ -952,6 +1002,15 @@ HWY_API Vec256 ShiftRight(const + return Vec256{_mm256_srai_epi32(v.raw, kBits)}; + } + ++template ++HWY_API Vec256 ShiftRight(const Vec256 v) { ++ const Full256 di; ++ const Full256 du; ++ const auto shifted = BitCast(di, ShiftRight(BitCast(du, v))); ++ const auto shifted_sign = BitCast(di, Set(du, 0x80 >> kBits)); ++ return (shifted ^ shifted_sign) - shifted_sign; ++} ++ + // i64 is implemented after BroadcastSignBit. + + // ------------------------------ BroadcastSignBit (ShiftRight, compare, mask) +@@ -989,6 +1048,15 @@ HWY_API Vec256 ShiftRight(const + #endif + } + ++HWY_API Vec256 Abs(const Vec256 v) { ++#if HWY_TARGET == HWY_AVX3 ++ return Vec256{_mm256_abs_epi64(v.raw)}; ++#else ++ const auto zero = Zero(Full256()); ++ return IfThenElse(MaskFromVec(BroadcastSignBit(v)), zero - v, v); ++#endif ++} ++ + // ------------------------------ ShiftLeftSame + + HWY_API Vec256 ShiftLeftSame(const Vec256 v, +@@ -1016,6 +1084,14 @@ HWY_API Vec256 ShiftLeftSame(co + return Vec256{_mm256_sll_epi64(v.raw, _mm_cvtsi32_si128(bits))}; + } + ++template ++HWY_API Vec256 ShiftLeftSame(const Vec256 v, const int bits) { ++ const Full256 d8; ++ const RepartitionToWide d16; ++ const auto shifted = BitCast(d8, ShiftLeftSame(BitCast(d16, v), bits)); ++ return shifted & Set(d8, (0xFF << bits) & 0xFF); ++} ++ + // ------------------------------ ShiftRightSame (BroadcastSignBit) + + HWY_API Vec256 ShiftRightSame(const Vec256 v, +@@ -1031,6 +1107,13 @@ HWY_API Vec256 ShiftRightSame( + return Vec256{_mm256_srl_epi64(v.raw, _mm_cvtsi32_si128(bits))}; + } + ++HWY_API Vec256 ShiftRightSame(Vec256 v, const int bits) { ++ const Full256 d8; ++ const RepartitionToWide d16; ++ const auto shifted = BitCast(d8, ShiftRightSame(BitCast(d16, v), bits)); ++ return shifted & Set(d8, 0xFF >> bits); ++} ++ + HWY_API Vec256 ShiftRightSame(const Vec256 v, + const int bits) { + return Vec256{_mm256_sra_epi16(v.raw, _mm_cvtsi32_si128(bits))}; +@@ -1053,6 +1136,14 @@ HWY_API Vec256 ShiftRightSame(c + #endif + } + ++HWY_API Vec256 ShiftRightSame(Vec256 v, const int bits) { ++ const Full256 di; ++ const Full256 du; ++ const auto shifted = BitCast(di, ShiftRightSame(BitCast(du, v), bits)); ++ const auto shifted_sign = BitCast(di, Set(du, 0x80 >> bits)); ++ return (shifted ^ shifted_sign) - shifted_sign; ++} ++ + // ------------------------------ Negate + + template +@@ -1335,6 +1426,123 @@ HWY_API void Stream(const Vec256 + _mm256_stream_pd(aligned, v.raw); + } + ++// ------------------------------ Scatter ++ ++// Work around warnings in the intrinsic definitions (passing -1 as a mask). ++HWY_DIAGNOSTICS(push) ++HWY_DIAGNOSTICS_OFF(disable : 4245 4365, ignored "-Wsign-conversion") ++ ++#if HWY_TARGET == HWY_AVX3 ++namespace detail { ++ ++template ++HWY_API void ScatterOffset(hwy::SizeTag<4> /* tag */, Vec256 v, ++ Full256 /* tag */, T* HWY_RESTRICT base, ++ const Vec256 offset) { ++ _mm256_i32scatter_epi32(base, offset.raw, v.raw, 1); ++} ++template ++HWY_API void ScatterIndex(hwy::SizeTag<4> /* tag */, Vec256 v, ++ Full256 /* tag */, T* HWY_RESTRICT base, ++ const Vec256 index) { ++ _mm256_i32scatter_epi32(base, index.raw, v.raw, 4); ++} ++ ++template ++HWY_API void ScatterOffset(hwy::SizeTag<8> /* tag */, Vec256 v, ++ Full256 /* tag */, T* HWY_RESTRICT base, ++ const Vec256 offset) { ++ _mm256_i64scatter_epi64(base, offset.raw, v.raw, 1); ++} ++template ++HWY_API void ScatterIndex(hwy::SizeTag<8> /* tag */, Vec256 v, ++ Full256 /* tag */, T* HWY_RESTRICT base, ++ const Vec256 index) { ++ _mm256_i64scatter_epi64(base, index.raw, v.raw, 8); ++} ++ ++} // namespace detail ++ ++template ++HWY_API void ScatterOffset(Vec256 v, Full256 d, T* HWY_RESTRICT base, ++ const Vec256 offset) { ++ static_assert(sizeof(T) == sizeof(Offset), "Must match for portability"); ++ return detail::ScatterOffset(hwy::SizeTag(), v, d, base, offset); ++} ++template ++HWY_API void ScatterIndex(Vec256 v, Full256 d, T* HWY_RESTRICT base, ++ const Vec256 index) { ++ static_assert(sizeof(T) == sizeof(Index), "Must match for portability"); ++ return detail::ScatterIndex(hwy::SizeTag(), v, d, base, index); ++} ++ ++template <> ++HWY_INLINE void ScatterOffset(Vec256 v, Full256 /* tag */, ++ float* HWY_RESTRICT base, ++ const Vec256 offset) { ++ _mm256_i32scatter_ps(base, offset.raw, v.raw, 1); ++} ++template <> ++HWY_INLINE void ScatterIndex(Vec256 v, Full256 /* tag */, ++ float* HWY_RESTRICT base, ++ const Vec256 index) { ++ _mm256_i32scatter_ps(base, index.raw, v.raw, 4); ++} ++ ++template <> ++HWY_INLINE void ScatterOffset(Vec256 v, ++ Full256 /* tag */, ++ double* HWY_RESTRICT base, ++ const Vec256 offset) { ++ _mm256_i64scatter_pd(base, offset.raw, v.raw, 1); ++} ++template <> ++HWY_INLINE void ScatterIndex(Vec256 v, ++ Full256 /* tag */, ++ double* HWY_RESTRICT base, ++ const Vec256 index) { ++ _mm256_i64scatter_pd(base, index.raw, v.raw, 8); ++} ++ ++#else ++ ++template ++HWY_API void ScatterOffset(Vec256 v, Full256 d, T* HWY_RESTRICT base, ++ const Vec256 offset) { ++ static_assert(sizeof(T) == sizeof(Offset), "Must match for portability"); ++ ++ constexpr size_t N = 32 / sizeof(T); ++ alignas(32) T lanes[N]; ++ Store(v, d, lanes); ++ ++ alignas(32) Offset offset_lanes[N]; ++ Store(offset, Simd(), offset_lanes); ++ ++ uint8_t* base_bytes = reinterpret_cast(base); ++ for (size_t i = 0; i < N; ++i) { ++ CopyBytes(&lanes[i], base_bytes + offset_lanes[i]); ++ } ++} ++ ++template ++HWY_API void ScatterIndex(Vec256 v, Full256 d, T* HWY_RESTRICT base, ++ const Vec256 index) { ++ static_assert(sizeof(T) == sizeof(Index), "Must match for portability"); ++ ++ constexpr size_t N = 32 / sizeof(T); ++ alignas(32) T lanes[N]; ++ Store(v, d, lanes); ++ ++ alignas(32) Index index_lanes[N]; ++ Store(index, Simd(), index_lanes); ++ ++ for (size_t i = 0; i < N; ++i) { ++ base[index_lanes[i]] = lanes[i]; ++ } ++} ++ ++#endif ++ + // ------------------------------ Gather + + namespace detail { +@@ -1374,13 +1582,13 @@ HWY_API Vec256 GatherIndex(hwy::SizeT + template + HWY_API Vec256 GatherOffset(Full256 d, const T* HWY_RESTRICT base, + const Vec256 offset) { +- static_assert(sizeof(T) == sizeof(Offset), "SVE requires same size base/ofs"); ++ static_assert(sizeof(T) == sizeof(Offset), "Must match for portability"); + return detail::GatherOffset(hwy::SizeTag(), d, base, offset); + } + template + HWY_API Vec256 GatherIndex(Full256 d, const T* HWY_RESTRICT base, + const Vec256 index) { +- static_assert(sizeof(T) == sizeof(Index), "SVE requires same size base/idx"); ++ static_assert(sizeof(T) == sizeof(Index), "Must match for portability"); + return detail::GatherIndex(hwy::SizeTag(), d, base, index); + } + +@@ -1410,6 +1618,8 @@ HWY_INLINE Vec256 GatherIndex{_mm256_i64gather_pd(base, index.raw, 8)}; + } + ++HWY_DIAGNOSTICS(pop) ++ + // ================================================== SWIZZLE + + template +@@ -1861,38 +2071,26 @@ HWY_API Vec256 ZipUpper(const V + return Vec256{_mm256_unpackhi_epi32(a.raw, b.raw)}; + } + +-// ------------------------------ Blocks ++// ------------------------------ Blocks (LowerHalf, ZeroExtendVector) ++ ++// _mm256_broadcastsi128_si256 has 7 cycle latency. _mm256_permute2x128_si256 is ++// slow on Zen1 (8 uops); we can avoid it for LowerLower and UpperLower, and on ++// UpperUpper at the cost of one extra cycle/instruction. + + // hiH,hiL loH,loL |-> hiL,loL (= lower halves) + template + HWY_API Vec256 ConcatLowerLower(const Vec256 hi, const Vec256 lo) { +- return Vec256{_mm256_permute2x128_si256(lo.raw, hi.raw, 0x20)}; ++ return Vec256{_mm256_inserti128_si256(lo.raw, LowerHalf(hi).raw, 1)}; + } + template <> + HWY_INLINE Vec256 ConcatLowerLower(const Vec256 hi, + const Vec256 lo) { +- return Vec256{_mm256_permute2f128_ps(lo.raw, hi.raw, 0x20)}; ++ return Vec256{_mm256_insertf128_ps(lo.raw, LowerHalf(hi).raw, 1)}; + } + template <> + HWY_INLINE Vec256 ConcatLowerLower(const Vec256 hi, + const Vec256 lo) { +- return Vec256{_mm256_permute2f128_pd(lo.raw, hi.raw, 0x20)}; +-} +- +-// hiH,hiL loH,loL |-> hiH,loH (= upper halves) +-template +-HWY_API Vec256 ConcatUpperUpper(const Vec256 hi, const Vec256 lo) { +- return Vec256{_mm256_permute2x128_si256(lo.raw, hi.raw, 0x31)}; +-} +-template <> +-HWY_INLINE Vec256 ConcatUpperUpper(const Vec256 hi, +- const Vec256 lo) { +- return Vec256{_mm256_permute2f128_ps(lo.raw, hi.raw, 0x31)}; +-} +-template <> +-HWY_INLINE Vec256 ConcatUpperUpper(const Vec256 hi, +- const Vec256 lo) { +- return Vec256{_mm256_permute2f128_pd(lo.raw, hi.raw, 0x31)}; ++ return Vec256{_mm256_insertf128_pd(lo.raw, LowerHalf(hi).raw, 1)}; + } + + // hiH,hiL loH,loL |-> hiL,loH (= inner halves / swap blocks) +@@ -1927,6 +2125,12 @@ HWY_INLINE Vec256 ConcatUpperLow + return Vec256{_mm256_blend_pd(hi.raw, lo.raw, 3)}; + } + ++// hiH,hiL loH,loL |-> hiH,loH (= upper halves) ++template ++HWY_API Vec256 ConcatUpperUpper(const Vec256 hi, const Vec256 lo) { ++ return ConcatUpperLower(hi, ZeroExtendVector(UpperHalf(lo))); ++} ++ + // ------------------------------ Odd/even lanes + + namespace detail { +@@ -2211,11 +2415,18 @@ HWY_API Vec128 DemoteTo(Full128< + _mm256_castsi256_si128(_mm256_permute4x64_epi64(i8, 0x88))}; + } + ++ // Avoid "value of intrinsic immediate argument '8' is out of range '0 - 7'". ++ // 8 is the correct value of _MM_FROUND_NO_EXC, which is allowed here. ++HWY_DIAGNOSTICS(push) ++HWY_DIAGNOSTICS_OFF(disable : 4556, ignored "-Wsign-conversion") ++ + HWY_API Vec128 DemoteTo(Full128 /* tag */, + const Vec256 v) { + return Vec128{_mm256_cvtps_ph(v.raw, _MM_FROUND_NO_EXC)}; + } + ++HWY_DIAGNOSTICS(pop) ++ + HWY_API Vec128 DemoteTo(Full128 /* tag */, + const Vec256 v) { + return Vec128{_mm256_cvtpd_ps(v.raw)}; +@@ -2241,7 +2452,7 @@ HWY_API Vec128 U8FromU32(con + return BitCast(Simd(), pair); + } + +-// ------------------------------ Convert integer <=> floating point ++// ------------------------------ Integer <=> fp (ShiftRight, OddEven) + + HWY_API Vec256 ConvertTo(Full256 /* tag */, + const Vec256 v) { +@@ -2253,13 +2464,20 @@ HWY_API Vec256 ConvertTo(Full256 + (void)dd; + return Vec256{_mm256_cvtepi64_pd(v.raw)}; + #else +- alignas(32) int64_t lanes_i[4]; +- Store(v, Full256(), lanes_i); +- alignas(32) double lanes_d[4]; +- for (size_t i = 0; i < 4; ++i) { +- lanes_d[i] = static_cast(lanes_i[i]); +- } +- return Load(dd, lanes_d); ++ // Based on wim's approach (https://stackoverflow.com/questions/41144668/) ++ const Repartition d32; ++ const Repartition d64; ++ ++ // Toggle MSB of lower 32-bits and insert exponent for 2^84 + 2^63 ++ const auto k84_63 = Set(d64, 0x4530000080000000ULL); ++ const auto v_upper = BitCast(dd, ShiftRight<32>(BitCast(d64, v)) ^ k84_63); ++ ++ // Exponent is 2^52, lower 32 bits from v (=> 32-bit OddEven) ++ const auto k52 = Set(d32, 0x43300000); ++ const auto v_lower = BitCast(dd, OddEven(k52, BitCast(d32, v))); ++ ++ const auto k84_63_52 = BitCast(dd, Set(d64, 0x4530000080100000ULL)); ++ return (v_upper - k84_63_52) + v_lower; // order matters! + #endif + } + +@@ -2334,8 +2552,7 @@ HWY_API uint64_t BitsFromMask(hwy::SizeT + const auto compressed = + _mm256_permute4x64_epi64(sign_bits, _MM_SHUFFLE(3, 1, 2, 0)); + return static_cast(_mm256_movemask_epi8(compressed)); +- +-#endif ++#endif // HWY_ARCH_X86_64 + } + + template +@@ -2473,75 +2690,100 @@ HWY_INLINE Vec256 Idx64x4FromB + return Load(d32, packed_array + 8 * mask_bits); + } + +-// Helper function called by both Compress and CompressStore - avoids a ++// Helper functions called by both Compress and CompressStore - avoids a + // redundant BitsFromMask in the latter. + +-HWY_API Vec256 Compress(Vec256 v, +- const uint64_t mask_bits) { +-#if HWY_TARGET == HWY_AVX3 +- return Vec256{ +- _mm256_maskz_compress_epi32(static_cast<__mmask8>(mask_bits), v.raw)}; +-#else +- const Vec256 idx = detail::Idx32x8FromBits(mask_bits); +- return Vec256{_mm256_permutevar8x32_epi32(v.raw, idx.raw)}; +-#endif +-} +-HWY_API Vec256 Compress(Vec256 v, const uint64_t mask_bits) { ++template ++HWY_API Vec256 Compress(hwy::SizeTag<4> /*tag*/, Vec256 v, ++ const uint64_t mask_bits) { ++ const auto vu = BitCast(Full256(), v); + #if HWY_TARGET == HWY_AVX3 +- return Vec256{ +- _mm256_maskz_compress_epi32(static_cast<__mmask8>(mask_bits), v.raw)}; ++ const __m256i ret = ++ _mm256_maskz_compress_epi32(static_cast<__mmask8>(mask_bits), vu.raw); + #else + const Vec256 idx = detail::Idx32x8FromBits(mask_bits); +- return Vec256{_mm256_permutevar8x32_epi32(v.raw, idx.raw)}; ++ const __m256i ret = _mm256_permutevar8x32_epi32(vu.raw, idx.raw); + #endif ++ return BitCast(Full256(), Vec256{ret}); + } + +-HWY_API Vec256 Compress(Vec256 v, +- const uint64_t mask_bits) { +-#if HWY_TARGET == HWY_AVX3 +- return Vec256{ +- _mm256_maskz_compress_epi64(static_cast<__mmask8>(mask_bits), v.raw)}; +-#else +- const Vec256 idx = detail::Idx64x4FromBits(mask_bits); +- return Vec256{_mm256_permutevar8x32_epi32(v.raw, idx.raw)}; +-#endif +-} +-HWY_API Vec256 Compress(Vec256 v, const uint64_t mask_bits) { ++template ++HWY_API Vec256 Compress(hwy::SizeTag<8> /*tag*/, Vec256 v, ++ const uint64_t mask_bits) { ++ const auto vu = BitCast(Full256(), v); + #if HWY_TARGET == HWY_AVX3 +- return Vec256{ +- _mm256_maskz_compress_epi64(static_cast<__mmask8>(mask_bits), v.raw)}; ++ const __m256i ret = ++ _mm256_maskz_compress_epi64(static_cast<__mmask8>(mask_bits), vu.raw); + #else + const Vec256 idx = detail::Idx64x4FromBits(mask_bits); +- return Vec256{_mm256_permutevar8x32_epi32(v.raw, idx.raw)}; ++ const __m256i ret = _mm256_permutevar8x32_epi32(vu.raw, idx.raw); + #endif ++ return BitCast(Full256(), Vec256{ret}); + } + +-HWY_API Vec256 Compress(Vec256 v, const uint64_t mask_bits) { +-#if HWY_TARGET == HWY_AVX3 +- return Vec256{ +- _mm256_maskz_compress_ps(static_cast<__mmask8>(mask_bits), v.raw)}; +-#else +- const Vec256 idx = detail::Idx32x8FromBits(mask_bits); +- return Vec256{_mm256_permutevar8x32_ps(v.raw, idx.raw)}; +-#endif +-} ++// Otherwise, defined in x86_512-inl.h so it can use wider vectors. ++#if HWY_TARGET != HWY_AVX3 + +-HWY_API Vec256 Compress(Vec256 v, const uint64_t mask_bits) { +-#if HWY_TARGET == HWY_AVX3 +- return Vec256{ +- _mm256_maskz_compress_pd(static_cast<__mmask8>(mask_bits), v.raw)}; +-#else +- const Vec256 idx = detail::Idx64x4FromBits(mask_bits); +- return Vec256{_mm256_castsi256_pd( +- _mm256_permutevar8x32_epi32(_mm256_castpd_si256(v.raw), idx.raw))}; +-#endif ++// LUTs are infeasible for 2^16 possible masks. Promoting to 32-bit and using ++// the native Compress is probably more efficient than 2 LUTs. ++template ++HWY_API Vec256 Compress(hwy::SizeTag<2> /*tag*/, Vec256 v, ++ const uint64_t mask_bits) { ++ using D = Full256; ++ const Rebind du; ++ const Repartition dw; ++ const auto vu16 = BitCast(du, v); // (required for float16_t inputs) ++ const auto promoted0 = PromoteTo(dw, LowerHalf(vu16)); ++ const auto promoted1 = PromoteTo(dw, UpperHalf(vu16)); ++ ++ const uint64_t mask_bits0 = mask_bits & 0xFF; ++ const uint64_t mask_bits1 = mask_bits >> 8; ++ const auto compressed0 = Compress(hwy::SizeTag<4>(), promoted0, mask_bits0); ++ const auto compressed1 = Compress(hwy::SizeTag<4>(), promoted1, mask_bits1); ++ ++ const Half dh; ++ const auto demoted0 = ZeroExtendVector(DemoteTo(dh, compressed0)); ++ const auto demoted1 = ZeroExtendVector(DemoteTo(dh, compressed1)); ++ ++ const size_t count0 = PopCount(mask_bits0); ++ // Now combine by shifting demoted1 up. AVX2 lacks VPERMW, so start with ++ // VPERMD for shifting at 4 byte granularity. ++ alignas(32) constexpr int32_t iota4[16] = {0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 1, 2, 3, 4, 5, 6, 7}; ++ const auto indices = SetTableIndices(dw, iota4 + 8 - count0 / 2); ++ const auto shift1_multiple4 = ++ BitCast(du, TableLookupLanes(BitCast(dw, demoted1), indices)); ++ ++ // Whole-register unconditional shift by 2 bytes. ++ // TODO(janwas): slow on AMD, use 2 shifts + permq + OR instead? ++ const __m256i lo_zz = _mm256_permute2x128_si256(shift1_multiple4.raw, ++ shift1_multiple4.raw, 0x08); ++ const auto shift1_multiple2 = ++ Vec256{_mm256_alignr_epi8(shift1_multiple4.raw, lo_zz, 14)}; ++ ++ // Make the shift conditional on the lower bit of count0. ++ const auto m_odd = TestBit(Set(du, count0), Set(du, 1)); ++ const auto shifted1 = IfThenElse(m_odd, shift1_multiple2, shift1_multiple4); ++ ++ // Blend the lower and shifted upper parts. ++ constexpr uint16_t on = 0xFFFF; ++ alignas(32) constexpr uint16_t lower_lanes[32] = {HWY_REP4(on), HWY_REP4(on), ++ HWY_REP4(on), HWY_REP4(on)}; ++ const auto m_lower = MaskFromVec(LoadU(du, lower_lanes + 16 - count0)); ++ return BitCast(D(), IfThenElse(m_lower, demoted0, shifted1)); + } + ++#endif // HWY_TARGET != HWY_AVX3 ++ + } // namespace detail + ++// Otherwise, defined in x86_512-inl.h after detail::Compress. ++#if HWY_TARGET != HWY_AVX3 ++ + template + HWY_API Vec256 Compress(Vec256 v, const Mask256 mask) { +- return detail::Compress(v, detail::BitsFromMask(mask)); ++ return detail::Compress(hwy::SizeTag(), v, ++ detail::BitsFromMask(mask)); + } + + // ------------------------------ CompressStore +@@ -2550,10 +2792,101 @@ template + HWY_API size_t CompressStore(Vec256 v, const Mask256 mask, Full256 d, + T* HWY_RESTRICT aligned) { + const uint64_t mask_bits = detail::BitsFromMask(mask); +- Store(detail::Compress(v, mask_bits), d, aligned); ++ // NOTE: it is tempting to split inputs into two halves for 16-bit lanes, but ++ // using StoreU to concatenate the results would cause page faults if ++ // `aligned` is the last valid vector. Instead rely on in-register splicing. ++ Store(detail::Compress(hwy::SizeTag(), v, mask_bits), d, aligned); + return PopCount(mask_bits); + } + ++#endif // HWY_TARGET != HWY_AVX3 ++ ++// ------------------------------ StoreInterleaved3 (CombineShiftRightBytes, ++// TableLookupBytes, ConcatUpperLower) ++ ++HWY_API void StoreInterleaved3(const Vec256 v0, ++ const Vec256 v1, ++ const Vec256 v2, Full256 d, ++ uint8_t* HWY_RESTRICT unaligned) { ++ const auto k5 = Set(d, 5); ++ const auto k6 = Set(d, 6); ++ ++ // Shuffle (v0,v1,v2) vector bytes to (MSB on left): r5, bgr[4:0]. ++ // 0x80 so lanes to be filled from other vectors are 0 for blending. ++ alignas(16) static constexpr uint8_t tbl_r0[16] = { ++ 0, 0x80, 0x80, 1, 0x80, 0x80, 2, 0x80, 0x80, // ++ 3, 0x80, 0x80, 4, 0x80, 0x80, 5}; ++ alignas(16) static constexpr uint8_t tbl_g0[16] = { ++ 0x80, 0, 0x80, 0x80, 1, 0x80, // ++ 0x80, 2, 0x80, 0x80, 3, 0x80, 0x80, 4, 0x80, 0x80}; ++ const auto shuf_r0 = LoadDup128(d, tbl_r0); ++ const auto shuf_g0 = LoadDup128(d, tbl_g0); // cannot reuse r0 due to 5 ++ const auto shuf_b0 = CombineShiftRightBytes<15>(shuf_g0, shuf_g0); ++ const auto r0 = TableLookupBytes(v0, shuf_r0); // 5..4..3..2..1..0 ++ const auto g0 = TableLookupBytes(v1, shuf_g0); // ..4..3..2..1..0. ++ const auto b0 = TableLookupBytes(v2, shuf_b0); // .4..3..2..1..0.. ++ const auto interleaved_10_00 = r0 | g0 | b0; ++ ++ // Second vector: g10,r10, bgr[9:6], b5,g5 ++ const auto shuf_r1 = shuf_b0 + k6; // .A..9..8..7..6.. ++ const auto shuf_g1 = shuf_r0 + k5; // A..9..8..7..6..5 ++ const auto shuf_b1 = shuf_g0 + k5; // ..9..8..7..6..5. ++ const auto r1 = TableLookupBytes(v0, shuf_r1); ++ const auto g1 = TableLookupBytes(v1, shuf_g1); ++ const auto b1 = TableLookupBytes(v2, shuf_b1); ++ const auto interleaved_15_05 = r1 | g1 | b1; ++ ++ // We want to write the lower halves of the interleaved vectors, then the ++ // upper halves. We could obtain 10_05 and 15_0A via ConcatUpperLower, but ++ // that would require two ununaligned stores. For the lower halves, we can ++ // merge two 128-bit stores for the same swizzling cost: ++ const auto out0 = ConcatLowerLower(interleaved_15_05, interleaved_10_00); ++ StoreU(out0, d, unaligned + 0 * 32); ++ ++ // Third vector: bgr[15:11], b10 ++ const auto shuf_r2 = shuf_b1 + k6; // ..F..E..D..C..B. ++ const auto shuf_g2 = shuf_r1 + k5; // .F..E..D..C..B.. ++ const auto shuf_b2 = shuf_g1 + k5; // F..E..D..C..B..A ++ const auto r2 = TableLookupBytes(v0, shuf_r2); ++ const auto g2 = TableLookupBytes(v1, shuf_g2); ++ const auto b2 = TableLookupBytes(v2, shuf_b2); ++ const auto interleaved_1A_0A = r2 | g2 | b2; ++ ++ const auto out1 = ConcatUpperLower(interleaved_10_00, interleaved_1A_0A); ++ StoreU(out1, d, unaligned + 1 * 32); ++ ++ const auto out2 = ConcatUpperUpper(interleaved_1A_0A, interleaved_15_05); ++ StoreU(out2, d, unaligned + 2 * 32); ++} ++ ++// ------------------------------ StoreInterleaved4 ++ ++HWY_API void StoreInterleaved4(const Vec256 v0, ++ const Vec256 v1, ++ const Vec256 v2, ++ const Vec256 v3, Full256 d, ++ uint8_t* HWY_RESTRICT unaligned) { ++ // let a,b,c,d denote v0..3. ++ const auto ba0 = ZipLower(v0, v1); // b7 a7 .. b0 a0 ++ const auto dc0 = ZipLower(v2, v3); // d7 c7 .. d0 c0 ++ const auto ba8 = ZipUpper(v0, v1); ++ const auto dc8 = ZipUpper(v2, v3); ++ const auto dcba_0 = ZipLower(ba0, dc0); // d..a13 d..a10 | d..a03 d..a00 ++ const auto dcba_4 = ZipUpper(ba0, dc0); // d..a17 d..a14 | d..a07 d..a04 ++ const auto dcba_8 = ZipLower(ba8, dc8); // d..a1B d..a18 | d..a0B d..a08 ++ const auto dcba_C = ZipUpper(ba8, dc8); // d..a1F d..a1C | d..a0F d..a0C ++ // Write lower halves, then upper. vperm2i128 is slow on Zen1 but we can ++ // efficiently combine two lower halves into 256 bits: ++ const auto out0 = BitCast(d, ConcatLowerLower(dcba_4, dcba_0)); ++ const auto out1 = BitCast(d, ConcatLowerLower(dcba_C, dcba_8)); ++ StoreU(out0, d, unaligned + 0 * 32); ++ StoreU(out1, d, unaligned + 1 * 32); ++ const auto out2 = BitCast(d, ConcatUpperUpper(dcba_4, dcba_0)); ++ const auto out3 = BitCast(d, ConcatUpperUpper(dcba_C, dcba_8)); ++ StoreU(out2, d, unaligned + 2 * 32); ++ StoreU(out3, d, unaligned + 3 * 32); ++} ++ + // ------------------------------ Reductions + + namespace detail { +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/ops/x86_256-inl.hE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/ops/x86_256-inl.hE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/ops/x86_512-inl.h.12 chromium-91.0.4472.77/third_party/highway/src/hwy/ops/x86_512-inl.h +--- chromium-91.0.4472.77/third_party/highway/src/hwy/ops/x86_512-inl.h.12 2021-06-02 10:56:05.218904306 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/ops/x86_512-inl.h 2021-05-31 10:37:11.000000000 -0400 +@@ -19,6 +19,23 @@ + // particular, "Broadcast", pack and zip behavior may be surprising. + + #include // AVX2+ ++#if defined(_MSC_VER) && defined(__clang__) ++// Including should be enough, but Clang's headers helpfully skip ++// including these headers when _MSC_VER is defined, like when using clang-cl. ++// Include these directly here. ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#endif ++ + #include + #include + +@@ -100,9 +117,8 @@ struct RawMask512<8> { + // Mask register: one bit per lane. + template + class Mask512 { +- using Raw = typename RawMask512::type; +- + public: ++ using Raw = typename RawMask512::type; + Raw raw; + }; + +@@ -167,23 +183,24 @@ HWY_API Vec512 Set(Full512{_mm512_set1_epi16(static_cast(t))}; // NOLINT + } + HWY_API Vec512 Set(Full512 /* tag */, const uint32_t t) { +- return Vec512{_mm512_set1_epi32(static_cast(t))}; // NOLINT ++ return Vec512{_mm512_set1_epi32(static_cast(t))}; + } + HWY_API Vec512 Set(Full512 /* tag */, const uint64_t t) { + return Vec512{ + _mm512_set1_epi64(static_cast(t))}; // NOLINT + } + HWY_API Vec512 Set(Full512 /* tag */, const int8_t t) { +- return Vec512{_mm512_set1_epi8(t)}; ++ return Vec512{_mm512_set1_epi8(static_cast(t))}; // NOLINT + } + HWY_API Vec512 Set(Full512 /* tag */, const int16_t t) { +- return Vec512{_mm512_set1_epi16(t)}; ++ return Vec512{_mm512_set1_epi16(static_cast(t))}; // NOLINT + } + HWY_API Vec512 Set(Full512 /* tag */, const int32_t t) { + return Vec512{_mm512_set1_epi32(t)}; + } + HWY_API Vec512 Set(Full512 /* tag */, const int64_t t) { +- return Vec512{_mm512_set1_epi64(t)}; ++ return Vec512{ ++ _mm512_set1_epi64(static_cast(t))}; // NOLINT + } + HWY_API Vec512 Set(Full512 /* tag */, const float t) { + return Vec512{_mm512_set1_ps(t)}; +@@ -329,7 +346,45 @@ HWY_API Vec512 CopySignToAbs(const Ve + return CopySign(abs, sign); + } + +-// ------------------------------ Select/blend ++// ------------------------------ FirstN ++ ++// Possibilities for constructing a bitmask of N ones: ++// - kshift* only consider the lowest byte of the shift count, so they would ++// not correctly handle large n. ++// - Scalar shifts >= 64 are UB. ++// - BZHI has the desired semantics; we assume AVX-512 implies BMI2. However, ++// we need 64-bit masks for sizeof(T) == 1, so special-case 32-bit builds. ++ ++#if HWY_ARCH_X86_32 ++namespace detail { ++ ++// 32 bit mask is sufficient for lane size >= 2. ++template ++HWY_API Mask512 FirstN(size_t n) { ++ using Bits = typename Mask512::Raw; ++ return Mask512{static_cast(_bzhi_u32(~uint32_t(0), n))}; ++} ++ ++template ++HWY_API Mask512 FirstN(size_t n) { ++ const uint64_t bits = n < 64 ? ((1ULL << n) - 1) : ~uint64_t(0); ++ return Mask512{static_cast<__mmask64>(bits)}; ++} ++ ++} // namespace detail ++#endif // HWY_ARCH_X86_32 ++ ++template ++HWY_API Mask512 FirstN(const Full512 /*tag*/, size_t n) { ++#if HWY_ARCH_X86_64 ++ using Bits = typename Mask512::Raw; ++ return Mask512{static_cast(_bzhi_u64(~uint64_t(0), n))}; ++#else ++ return detail::FirstN(n); ++#endif // HWY_ARCH_X86_64 ++} ++ ++// ------------------------------ IfThenElse + + // Returns mask ? b : a. + +@@ -626,7 +681,13 @@ HWY_API Vec512 AverageRound(co + + // Returns absolute value, except that LimitsMin() maps to LimitsMax() + 1. + HWY_API Vec512 Abs(const Vec512 v) { ++#if HWY_COMPILER_MSVC ++ // Workaround for incorrect codegen? (untested due to internal compiler error) ++ const auto zero = Zero(Full512()); ++ return Vec512{_mm512_max_epi8(v.raw, (zero - v).raw)}; ++#else + return Vec512{_mm512_abs_epi8(v.raw)}; ++#endif + } + HWY_API Vec512 Abs(const Vec512 v) { + return Vec512{_mm512_abs_epi16(v.raw)}; +@@ -634,6 +695,9 @@ HWY_API Vec512 Abs(const Vec512 + HWY_API Vec512 Abs(const Vec512 v) { + return Vec512{_mm512_abs_epi32(v.raw)}; + } ++HWY_API Vec512 Abs(const Vec512 v) { ++ return Vec512{_mm512_abs_epi64(v.raw)}; ++} + + // These aren't native instructions, they also involve AND with constant. + HWY_API Vec512 Abs(const Vec512 v) { +@@ -675,6 +739,16 @@ HWY_API Vec512 ShiftLeft(const + return Vec512{_mm512_slli_epi64(v.raw, kBits)}; + } + ++template ++HWY_API Vec512 ShiftLeft(const Vec512 v) { ++ const Full512 d8; ++ const RepartitionToWide d16; ++ const auto shifted = BitCast(d8, ShiftLeft(BitCast(d16, v))); ++ return kBits == 1 ++ ? (v + v) ++ : (shifted & Set(d8, static_cast((0xFF << kBits) & 0xFF))); ++} ++ + // ------------------------------ ShiftRight + + template +@@ -693,6 +767,14 @@ HWY_API Vec512 ShiftRight(cons + } + + template ++HWY_API Vec512 ShiftRight(const Vec512 v) { ++ const Full512 d8; ++ // Use raw instead of BitCast to support N=1. ++ const Vec512 shifted{ShiftRight(Vec512{v.raw}).raw}; ++ return shifted & Set(d8, 0xFF >> kBits); ++} ++ ++template + HWY_API Vec512 ShiftRight(const Vec512 v) { + return Vec512{_mm512_srai_epi16(v.raw, kBits)}; + } +@@ -707,6 +789,15 @@ HWY_API Vec512 ShiftRight(const + return Vec512{_mm512_srai_epi64(v.raw, kBits)}; + } + ++template ++HWY_API Vec512 ShiftRight(const Vec512 v) { ++ const Full512 di; ++ const Full512 du; ++ const auto shifted = BitCast(di, ShiftRight(BitCast(du, v))); ++ const auto shifted_sign = BitCast(di, Set(du, 0x80 >> kBits)); ++ return (shifted ^ shifted_sign) - shifted_sign; ++} ++ + // ------------------------------ ShiftLeftSame + + HWY_API Vec512 ShiftLeftSame(const Vec512 v, +@@ -734,6 +825,14 @@ HWY_API Vec512 ShiftLeftSame(co + return Vec512{_mm512_sll_epi64(v.raw, _mm_cvtsi32_si128(bits))}; + } + ++template ++HWY_API Vec512 ShiftLeftSame(const Vec512 v, const int bits) { ++ const Full512 d8; ++ const RepartitionToWide d16; ++ const auto shifted = BitCast(d8, ShiftLeftSame(BitCast(d16, v), bits)); ++ return shifted & Set(d8, (0xFF << bits) & 0xFF); ++} ++ + // ------------------------------ ShiftRightSame + + HWY_API Vec512 ShiftRightSame(const Vec512 v, +@@ -749,6 +848,13 @@ HWY_API Vec512 ShiftRightSame( + return Vec512{_mm512_srl_epi64(v.raw, _mm_cvtsi32_si128(bits))}; + } + ++HWY_API Vec512 ShiftRightSame(Vec512 v, const int bits) { ++ const Full512 d8; ++ const RepartitionToWide d16; ++ const auto shifted = BitCast(d8, ShiftRightSame(BitCast(d16, v), bits)); ++ return shifted & Set(d8, 0xFF >> bits); ++} ++ + HWY_API Vec512 ShiftRightSame(const Vec512 v, + const int bits) { + return Vec512{_mm512_sra_epi16(v.raw, _mm_cvtsi32_si128(bits))}; +@@ -763,6 +869,14 @@ HWY_API Vec512 ShiftRightSame(c + return Vec512{_mm512_sra_epi64(v.raw, _mm_cvtsi32_si128(bits))}; + } + ++HWY_API Vec512 ShiftRightSame(Vec512 v, const int bits) { ++ const Full512 di; ++ const Full512 du; ++ const auto shifted = BitCast(di, ShiftRightSame(BitCast(du, v), bits)); ++ const auto shifted_sign = BitCast(di, Set(du, 0x80 >> bits)); ++ return (shifted ^ shifted_sign) - shifted_sign; ++} ++ + // ------------------------------ Shl + + HWY_API Vec512 operator<<(const Vec512 v, +@@ -1046,6 +1160,10 @@ HWY_API Vec512 ApproximateRecipro + + // ------------------------------ Floating-point rounding + ++// Work around warnings in the intrinsic definitions (passing -1 as a mask). ++HWY_DIAGNOSTICS(push) ++HWY_DIAGNOSTICS_OFF(disable : 4245 4365, ignored "-Wsign-conversion") ++ + // Toward nearest integer, tie to even + HWY_API Vec512 Round(const Vec512 v) { + return Vec512{_mm512_roundscale_ps( +@@ -1086,6 +1204,8 @@ HWY_API Vec512 Floor(const Vec51 + _mm512_roundscale_pd(v.raw, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC)}; + } + ++HWY_DIAGNOSTICS(pop) ++ + // ================================================== COMPARE + + // Comparisons set a mask bit to 1 if the condition is true, else 0. +@@ -1678,6 +1798,83 @@ HWY_API void Stream(const Vec512 + _mm512_stream_pd(aligned, v.raw); + } + ++// ------------------------------ Scatter ++ ++// Work around warnings in the intrinsic definitions (passing -1 as a mask). ++HWY_DIAGNOSTICS(push) ++HWY_DIAGNOSTICS_OFF(disable : 4245 4365, ignored "-Wsign-conversion") ++ ++namespace detail { ++ ++template ++HWY_API void ScatterOffset(hwy::SizeTag<4> /* tag */, Vec512 v, ++ Full512 /* tag */, T* HWY_RESTRICT base, ++ const Vec512 offset) { ++ _mm512_i32scatter_epi32(base, offset.raw, v.raw, 1); ++} ++template ++HWY_API void ScatterIndex(hwy::SizeTag<4> /* tag */, Vec512 v, ++ Full512 /* tag */, T* HWY_RESTRICT base, ++ const Vec512 index) { ++ _mm512_i32scatter_epi32(base, index.raw, v.raw, 4); ++} ++ ++template ++HWY_API void ScatterOffset(hwy::SizeTag<8> /* tag */, Vec512 v, ++ Full512 /* tag */, T* HWY_RESTRICT base, ++ const Vec512 offset) { ++ _mm512_i64scatter_epi64(base, offset.raw, v.raw, 1); ++} ++template ++HWY_API void ScatterIndex(hwy::SizeTag<8> /* tag */, Vec512 v, ++ Full512 /* tag */, T* HWY_RESTRICT base, ++ const Vec512 index) { ++ _mm512_i64scatter_epi64(base, index.raw, v.raw, 8); ++} ++ ++} // namespace detail ++ ++template ++HWY_API void ScatterOffset(Vec512 v, Full512 d, T* HWY_RESTRICT base, ++ const Vec512 offset) { ++ static_assert(sizeof(T) == sizeof(Offset), "Must match for portability"); ++ return detail::ScatterOffset(hwy::SizeTag(), v, d, base, offset); ++} ++template ++HWY_API void ScatterIndex(Vec512 v, Full512 d, T* HWY_RESTRICT base, ++ const Vec512 index) { ++ static_assert(sizeof(T) == sizeof(Index), "Must match for portability"); ++ return detail::ScatterIndex(hwy::SizeTag(), v, d, base, index); ++} ++ ++template <> ++HWY_INLINE void ScatterOffset(Vec512 v, Full512 /* tag */, ++ float* HWY_RESTRICT base, ++ const Vec512 offset) { ++ _mm512_i32scatter_ps(base, offset.raw, v.raw, 1); ++} ++template <> ++HWY_INLINE void ScatterIndex(Vec512 v, Full512 /* tag */, ++ float* HWY_RESTRICT base, ++ const Vec512 index) { ++ _mm512_i32scatter_ps(base, index.raw, v.raw, 4); ++} ++ ++template <> ++HWY_INLINE void ScatterOffset(Vec512 v, ++ Full512 /* tag */, ++ double* HWY_RESTRICT base, ++ const Vec512 offset) { ++ _mm512_i64scatter_pd(base, offset.raw, v.raw, 1); ++} ++template <> ++HWY_INLINE void ScatterIndex(Vec512 v, ++ Full512 /* tag */, ++ double* HWY_RESTRICT base, ++ const Vec512 index) { ++ _mm512_i64scatter_pd(base, index.raw, v.raw, 8); ++} ++ + // ------------------------------ Gather + + namespace detail { +@@ -1713,13 +1910,13 @@ HWY_API Vec512 GatherIndex(hwy::SizeT + template + HWY_API Vec512 GatherOffset(Full512 d, const T* HWY_RESTRICT base, + const Vec512 offset) { +- static_assert(sizeof(T) == sizeof(Offset), "SVE requires same size base/ofs"); ++static_assert(sizeof(T) == sizeof(Offset), "Must match for portability"); + return detail::GatherOffset(hwy::SizeTag(), d, base, offset); + } + template + HWY_API Vec512 GatherIndex(Full512 d, const T* HWY_RESTRICT base, + const Vec512 index) { +- static_assert(sizeof(T) == sizeof(Index), "SVE requires same size base/idx"); ++ static_assert(sizeof(T) == sizeof(Index), "Must match for portability"); + return detail::GatherIndex(hwy::SizeTag(), d, base, index); + } + +@@ -1749,6 +1946,8 @@ HWY_INLINE Vec512 GatherIndex{_mm512_i64gather_pd(index.raw, base, 8)}; + } + ++HWY_DIAGNOSTICS(pop) ++ + // ================================================== SWIZZLE + + template +@@ -2439,7 +2638,11 @@ HWY_API Vec256 DemoteTo(Full256< + + HWY_API Vec256 DemoteTo(Full256 /* tag */, + const Vec512 v) { ++ // Work around warnings in the intrinsic definitions (passing -1 as a mask). ++ HWY_DIAGNOSTICS(push) ++ HWY_DIAGNOSTICS_OFF(disable : 4245 4365, ignored "-Wsign-conversion") + return Vec256{_mm512_cvtps_ph(v.raw, _MM_FROUND_NO_EXC)}; ++ HWY_DIAGNOSTICS(pop) + } + + HWY_API Vec256 DemoteTo(Full256 /* tag */, +@@ -2633,8 +2836,81 @@ HWY_API Vec512 Compress(Vec512{_mm512_maskz_compress_pd(mask.raw, v.raw)}; + } + ++namespace detail { ++ ++// Ignore IDE redefinition error for these two functions: if this header is ++// included, then the functions weren't actually defined in x86_256-inl.h. ++template ++HWY_API Vec256 Compress(hwy::SizeTag<2> /*tag*/, Vec256 v, ++ const uint64_t mask_bits) { ++ using D = Full256; ++ const Rebind du; ++ const Rebind dw; // 512-bit, not 256! ++ const auto vu16 = BitCast(du, v); // (required for float16_t inputs) ++ const Mask512 mask{static_cast<__mmask16>(mask_bits)}; ++ return BitCast(D(), DemoteTo(du, Compress(PromoteTo(dw, vu16), mask))); ++} ++ ++} // namespace detail ++ ++template ++HWY_API Vec256 Compress(Vec256 v, const Mask256 mask) { ++ return detail::Compress(hwy::SizeTag(), v, ++ detail::BitsFromMask(mask)); ++} ++ ++// Expands to 32-bit, compresses, concatenate demoted halves. ++template ++HWY_API Vec512 Compress(Vec512 v, const Mask512 mask) { ++ using D = Full512; ++ const Rebind du; ++ const Repartition dw; ++ const auto vu16 = BitCast(du, v); // (required for float16_t inputs) ++ const auto promoted0 = PromoteTo(dw, LowerHalf(vu16)); ++ const auto promoted1 = PromoteTo(dw, UpperHalf(vu16)); ++ ++ const Mask512 mask0{static_cast<__mmask16>(mask.raw & 0xFFFF)}; ++ const Mask512 mask1{static_cast<__mmask16>(mask.raw >> 16)}; ++ const auto compressed0 = Compress(promoted0, mask0); ++ const auto compressed1 = Compress(promoted1, mask1); ++ ++ const Half dh; ++ const auto demoted0 = ZeroExtendVector(DemoteTo(dh, compressed0)); ++ const auto demoted1 = ZeroExtendVector(DemoteTo(dh, compressed1)); ++ ++ // Concatenate into single vector by shifting upper with writemask. ++ const size_t num0 = CountTrue(mask0); ++ const __mmask32 m_upper = ~((1u << num0) - 1); ++ alignas(64) uint16_t iota[64] = { ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, ++ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; ++ const auto idx = LoadU(du, iota + 32 - num0); ++ return Vec512{_mm512_mask_permutexvar_epi16(demoted0.raw, m_upper, idx.raw, ++ demoted1.raw)}; ++} ++ + // ------------------------------ CompressStore + ++template ++HWY_API size_t CompressStore(Vec256 v, const Mask256 mask, Full256 d, ++ T* HWY_RESTRICT aligned) { ++ const uint64_t mask_bits = detail::BitsFromMask(mask); ++ Store(detail::Compress(hwy::SizeTag(), v, mask_bits), d, aligned); ++ return PopCount(mask_bits); ++} ++ ++template ++HWY_API size_t CompressStore(Vec512 v, const Mask512 mask, Full512 d, ++ T* HWY_RESTRICT aligned) { ++ // NOTE: it is tempting to split inputs into two halves for 16-bit lanes, but ++ // using StoreU to concatenate the results would cause page faults if ++ // `aligned` is the last valid vector. Instead rely on in-register splicing. ++ Store(Compress(v, mask), d, aligned); ++ return CountTrue(mask); ++} ++ + HWY_API size_t CompressStore(Vec512 v, const Mask512 mask, + Full512 /* tag */, + uint32_t* HWY_RESTRICT aligned) { +@@ -2675,6 +2951,98 @@ HWY_API size_t CompressStore(Vec512 a, const Vec512 b, ++ const Vec512 c, Full512 d, ++ uint8_t* HWY_RESTRICT unaligned) { ++ const auto k5 = Set(d, 5); ++ const auto k6 = Set(d, 6); ++ ++ // Shuffle (a,b,c) vector bytes to (MSB on left): r5, bgr[4:0]. ++ // 0x80 so lanes to be filled from other vectors are 0 for blending. ++ alignas(16) static constexpr uint8_t tbl_r0[16] = { ++ 0, 0x80, 0x80, 1, 0x80, 0x80, 2, 0x80, 0x80, // ++ 3, 0x80, 0x80, 4, 0x80, 0x80, 5}; ++ alignas(16) static constexpr uint8_t tbl_g0[16] = { ++ 0x80, 0, 0x80, 0x80, 1, 0x80, // ++ 0x80, 2, 0x80, 0x80, 3, 0x80, 0x80, 4, 0x80, 0x80}; ++ const auto shuf_r0 = LoadDup128(d, tbl_r0); ++ const auto shuf_g0 = LoadDup128(d, tbl_g0); // cannot reuse r0 due to 5 ++ const auto shuf_b0 = CombineShiftRightBytes<15>(shuf_g0, shuf_g0); ++ const auto r0 = TableLookupBytes(a, shuf_r0); // 5..4..3..2..1..0 ++ const auto g0 = TableLookupBytes(b, shuf_g0); // ..4..3..2..1..0. ++ const auto b0 = TableLookupBytes(c, shuf_b0); // .4..3..2..1..0.. ++ const auto i = (r0 | g0 | b0).raw; // low byte in each 128bit: 30 20 10 00 ++ ++ // Second vector: g10,r10, bgr[9:6], b5,g5 ++ const auto shuf_r1 = shuf_b0 + k6; // .A..9..8..7..6.. ++ const auto shuf_g1 = shuf_r0 + k5; // A..9..8..7..6..5 ++ const auto shuf_b1 = shuf_g0 + k5; // ..9..8..7..6..5. ++ const auto r1 = TableLookupBytes(a, shuf_r1); ++ const auto g1 = TableLookupBytes(b, shuf_g1); ++ const auto b1 = TableLookupBytes(c, shuf_b1); ++ const auto j = (r1 | g1 | b1).raw; // low byte in each 128bit: 35 25 15 05 ++ ++ // Third vector: bgr[15:11], b10 ++ const auto shuf_r2 = shuf_b1 + k6; // ..F..E..D..C..B. ++ const auto shuf_g2 = shuf_r1 + k5; // .F..E..D..C..B.. ++ const auto shuf_b2 = shuf_g1 + k5; // F..E..D..C..B..A ++ const auto r2 = TableLookupBytes(a, shuf_r2); ++ const auto g2 = TableLookupBytes(b, shuf_g2); ++ const auto b2 = TableLookupBytes(c, shuf_b2); ++ const auto k = (r2 | g2 | b2).raw; // low byte in each 128bit: 3A 2A 1A 0A ++ ++ // To obtain 10 0A 05 00 in one vector, transpose "rows" into "columns". ++ const auto k3_k0_i3_i0 = _mm512_shuffle_i64x2(i, k, _MM_SHUFFLE(3, 0, 3, 0)); ++ const auto i1_i2_j0_j1 = _mm512_shuffle_i64x2(j, i, _MM_SHUFFLE(1, 2, 0, 1)); ++ const auto j2_j3_k1_k2 = _mm512_shuffle_i64x2(k, j, _MM_SHUFFLE(2, 3, 1, 2)); ++ ++ // Alternating order, most-significant 128 bits from the second arg. ++ const __mmask8 m = 0xCC; ++ const auto i1_k0_j0_i0 = _mm512_mask_blend_epi64(m, k3_k0_i3_i0, i1_i2_j0_j1); ++ const auto j2_i2_k1_j1 = _mm512_mask_blend_epi64(m, i1_i2_j0_j1, j2_j3_k1_k2); ++ const auto k3_j3_i3_k2 = _mm512_mask_blend_epi64(m, j2_j3_k1_k2, k3_k0_i3_i0); ++ ++ StoreU(Vec512{i1_k0_j0_i0}, d, unaligned + 0 * 64); // 10 0A 05 00 ++ StoreU(Vec512{j2_i2_k1_j1}, d, unaligned + 1 * 64); // 25 20 1A 15 ++ StoreU(Vec512{k3_j3_i3_k2}, d, unaligned + 2 * 64); // 3A 35 30 2A ++} ++ ++// ------------------------------ StoreInterleaved4 ++ ++HWY_API void StoreInterleaved4(const Vec512 v0, ++ const Vec512 v1, ++ const Vec512 v2, ++ const Vec512 v3, Full512 d, ++ uint8_t* HWY_RESTRICT unaligned) { ++ // let a,b,c,d denote v0..3. ++ const auto ba0 = ZipLower(v0, v1); // b7 a7 .. b0 a0 ++ const auto dc0 = ZipLower(v2, v3); // d7 c7 .. d0 c0 ++ const auto ba8 = ZipUpper(v0, v1); ++ const auto dc8 = ZipUpper(v2, v3); ++ const auto i = ZipLower(ba0, dc0).raw; // 4x128bit: d..a3 d..a0 ++ const auto j = ZipUpper(ba0, dc0).raw; // 4x128bit: d..a7 d..a4 ++ const auto k = ZipLower(ba8, dc8).raw; // 4x128bit: d..aB d..a8 ++ const auto l = ZipUpper(ba8, dc8).raw; // 4x128bit: d..aF d..aC ++ // 128-bit blocks were independent until now; transpose 4x4. ++ const auto j1_j0_i1_i0 = _mm512_shuffle_i64x2(i, j, _MM_SHUFFLE(1, 0, 1, 0)); ++ const auto l1_l0_k1_k0 = _mm512_shuffle_i64x2(k, l, _MM_SHUFFLE(1, 0, 1, 0)); ++ const auto j3_j2_i3_i2 = _mm512_shuffle_i64x2(i, j, _MM_SHUFFLE(3, 2, 3, 2)); ++ const auto l3_l2_k3_k2 = _mm512_shuffle_i64x2(k, l, _MM_SHUFFLE(3, 2, 3, 2)); ++ constexpr int k20 = _MM_SHUFFLE(2, 0, 2, 0); ++ constexpr int k31 = _MM_SHUFFLE(3, 1, 3, 1); ++ const auto l0_k0_j0_i0 = _mm512_shuffle_i64x2(j1_j0_i1_i0, l1_l0_k1_k0, k20); ++ const auto l1_k1_j1_i1 = _mm512_shuffle_i64x2(j1_j0_i1_i0, l1_l0_k1_k0, k31); ++ const auto l2_k2_j2_i2 = _mm512_shuffle_i64x2(j3_j2_i3_i2, l3_l2_k3_k2, k20); ++ const auto l3_k3_j3_i3 = _mm512_shuffle_i64x2(j3_j2_i3_i2, l3_l2_k3_k2, k31); ++ StoreU(Vec512{l0_k0_j0_i0}, d, unaligned + 0 * 64); ++ StoreU(Vec512{l1_k1_j1_i1}, d, unaligned + 1 * 64); ++ StoreU(Vec512{l2_k2_j2_i2}, d, unaligned + 2 * 64); ++ StoreU(Vec512{l3_k3_j3_i3}, d, unaligned + 3 * 64); ++} ++ + // ------------------------------ Reductions + + // Returns the sum in each lane. +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/ops/x86_512-inl.hE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/ops/x86_512-inl.hE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/targets.cc.12 chromium-91.0.4472.77/third_party/highway/src/hwy/targets.cc +--- chromium-91.0.4472.77/third_party/highway/src/hwy/targets.cc.12 2021-06-02 10:56:05.281904625 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/targets.cc 2021-05-31 10:37:11.000000000 -0400 +@@ -28,12 +28,12 @@ + + #if HWY_ARCH_X86 + #include +-#ifdef _MSC_VER ++#if HWY_COMPILER_MSVC + #include +-#else ++#else // HWY_COMPILER_MSVC + #include +-#endif +-#endif ++#endif // HWY_COMPILER_MSVC ++#endif // HWY_ARCH_X86 + + namespace hwy { + namespace { +@@ -48,13 +48,13 @@ bool IsBitSet(const uint32_t reg, const + // in abcd array where abcd = {eax, ebx, ecx, edx} (hence the name abcd). + void Cpuid(const uint32_t level, const uint32_t count, + uint32_t* HWY_RESTRICT abcd) { +-#ifdef _MSC_VER ++#if HWY_COMPILER_MSVC + int regs[4]; + __cpuidex(regs, level, count); + for (int i = 0; i < 4; ++i) { + abcd[i] = regs[i]; + } +-#else ++#else // HWY_COMPILER_MSVC + uint32_t a; + uint32_t b; + uint32_t c; +@@ -64,22 +64,22 @@ void Cpuid(const uint32_t level, const u + abcd[1] = b; + abcd[2] = c; + abcd[3] = d; +-#endif ++#endif // HWY_COMPILER_MSVC + } + + // Returns the lower 32 bits of extended control register 0. + // Requires CPU support for "OSXSAVE" (see below). + uint32_t ReadXCR0() { +-#ifdef _MSC_VER ++#if HWY_COMPILER_MSVC + return static_cast(_xgetbv(0)); +-#else ++#else // HWY_COMPILER_MSVC + uint32_t xcr0, xcr0_high; + const uint32_t index = 0; + asm volatile(".byte 0x0F, 0x01, 0xD0" + : "=a"(xcr0), "=d"(xcr0_high) + : "c"(index)); + return xcr0; +-#endif ++#endif // HWY_COMPILER_MSVC + } + + #endif // HWY_ARCH_X86 +@@ -126,7 +126,7 @@ constexpr uint32_t kAVX512VL = 1u << 13; + constexpr uint32_t kAVX512DQ = 1u << 14; + constexpr uint32_t kAVX512BW = 1u << 15; + constexpr uint32_t kGroupAVX3 = kAVX512F | kAVX512VL | kAVX512DQ | kAVX512BW; +-#endif ++#endif // HWY_ARCH_X86 + + } // namespace + +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/targets.ccE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/targets.ccE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/targets.h.12 chromium-91.0.4472.77/third_party/highway/src/hwy/targets.h +--- chromium-91.0.4472.77/third_party/highway/src/hwy/targets.h.12 2021-06-02 10:56:05.267904554 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/targets.h 2021-05-31 10:37:11.000000000 -0400 +@@ -65,7 +65,9 @@ + // HWY_MAX_DYNAMIC_TARGETS in total. + #define HWY_HIGHEST_TARGET_BIT_X86 9 + +-// 0x400, 0x800, 0x1000 reserved for SVE, SVE2, Helium ++#define HWY_SVE2 0x400 ++#define HWY_SVE 0x800 ++// 0x1000 reserved for Helium + #define HWY_NEON 0x2000 + + #define HWY_HIGHEST_TARGET_BIT_ARM 13 +@@ -90,6 +92,9 @@ + // 0x2000000, 0x4000000, 0x8000000, 0x10000000 reserved + + #define HWY_SCALAR 0x20000000 ++ ++#define HWY_HIGHEST_TARGET_BIT_SCALAR 29 ++ + // Cannot use higher values, otherwise HWY_TARGETS computation might overflow. + + //------------------------------------------------------------------------------ +@@ -106,25 +111,26 @@ + #ifndef HWY_BROKEN_TARGETS + + // x86 clang-6: we saw multiple AVX2/3 compile errors and in one case invalid +-// SSE4 codegen (msan failure), so disable all those targets. ++// SSE4 codegen (possibly only for msan), so disable all those targets. + #if HWY_ARCH_X86 && (HWY_COMPILER_CLANG != 0 && HWY_COMPILER_CLANG < 700) +-// TODO: Disable all non-scalar targets for every build target once we have +-// clang-7 enabled in our builders. +-#ifdef MEMORY_SANITIZER + #define HWY_BROKEN_TARGETS (HWY_SSE4 | HWY_AVX2 | HWY_AVX3) +-#else +-#define HWY_BROKEN_TARGETS 0 +-#endif + // This entails a major speed reduction, so warn unless the user explicitly + // opts in to scalar-only. + #if !defined(HWY_COMPILE_ONLY_SCALAR) + #pragma message("x86 Clang <= 6: define HWY_COMPILE_ONLY_SCALAR or upgrade.") + #endif + +-// MSVC, or 32-bit may fail to compile AVX2/3. +-#elif HWY_COMPILER_MSVC != 0 || HWY_ARCH_X86_32 ++// 32-bit may fail to compile AVX2/3. ++#elif HWY_ARCH_X86_32 + #define HWY_BROKEN_TARGETS (HWY_AVX2 | HWY_AVX3) +-#pragma message("Disabling AVX2/3 due to known issues with MSVC/32-bit builds") ++ ++// MSVC AVX3 support is buggy: https://github.com/Mysticial/Flops/issues/16 ++#elif HWY_COMPILER_MSVC != 0 ++#define HWY_BROKEN_TARGETS (HWY_AVX3) ++ ++// armv7be has not been tested and is not yet supported. ++#elif HWY_ARCH_ARM_V7 && (defined(__ARM_BIG_ENDIAN) || defined(__BIG_ENDIAN)) ++#define HWY_BROKEN_TARGETS (HWY_NEON) + + #else + #define HWY_BROKEN_TARGETS 0 +@@ -145,53 +151,74 @@ + // user to override this without any guarantee of success. + #ifndef HWY_BASELINE_TARGETS + +-#ifdef __wasm_simd128__ ++// Also check HWY_ARCH to ensure that simulating unknown platforms ends up with ++// HWY_TARGET == HWY_SCALAR. ++ ++#if HWY_ARCH_WASM && defined(__wasm_simd128__) + #define HWY_BASELINE_WASM HWY_WASM + #else + #define HWY_BASELINE_WASM 0 + #endif + +-#ifdef __VSX__ ++// Avoid choosing the PPC target until we have an implementation. ++#if HWY_ARCH_PPC && defined(__VSX__) && 0 + #define HWY_BASELINE_PPC8 HWY_PPC8 + #else + #define HWY_BASELINE_PPC8 0 + #endif + +-// GCC 4.5.4 only defines the former; 5.4 defines both. +-#if defined(__ARM_NEON__) || defined(__ARM_NEON) ++// Avoid choosing the SVE[2] targets the implementation is ready. ++#if HWY_ARCH_ARM && defined(__ARM_FEATURE_SVE2) && 0 ++#define HWY_BASELINE_SVE2 HWY_SVE2 ++#else ++#define HWY_BASELINE_SVE2 0 ++#endif ++ ++#if HWY_ARCH_ARM && defined(__ARM_FEATURE_SVE) && 0 ++#define HWY_BASELINE_SVE HWY_SVE ++#else ++#define HWY_BASELINE_SVE 0 ++#endif ++ ++// GCC 4.5.4 only defines __ARM_NEON__; 5.4 defines both. ++#if HWY_ARCH_ARM && (defined(__ARM_NEON__) || defined(__ARM_NEON)) + #define HWY_BASELINE_NEON HWY_NEON + #else + #define HWY_BASELINE_NEON 0 + #endif + +-#ifdef __SSE4_1__ ++// MSVC does not set SSE4_1, but it does set AVX; checking for the latter means ++// we at least get SSE4 on machines supporting AVX but not AVX2. ++// https://stackoverflow.com/questions/18563978/ ++#if HWY_ARCH_X86 && \ ++ (defined(__SSE4_1__) || (HWY_COMPILER_MSVC != 0 && defined(__AVX__))) + #define HWY_BASELINE_SSE4 HWY_SSE4 + #else + #define HWY_BASELINE_SSE4 0 + #endif + +-#ifdef __AVX2__ ++#if HWY_ARCH_X86 && defined(__AVX2__) + #define HWY_BASELINE_AVX2 HWY_AVX2 + #else + #define HWY_BASELINE_AVX2 0 + #endif + +-#ifdef __AVX512F__ ++#if HWY_ARCH_X86 && defined(__AVX512F__) + #define HWY_BASELINE_AVX3 HWY_AVX3 + #else + #define HWY_BASELINE_AVX3 0 + #endif + +-#ifdef __riscv_vector ++#if HWY_ARCH_RVV && defined(__riscv_vector) + #define HWY_BASELINE_RVV HWY_RVV + #else + #define HWY_BASELINE_RVV 0 + #endif + + #define HWY_BASELINE_TARGETS \ +- (HWY_SCALAR | HWY_BASELINE_WASM | HWY_BASELINE_PPC8 | HWY_BASELINE_NEON | \ +- HWY_BASELINE_SSE4 | HWY_BASELINE_AVX2 | HWY_BASELINE_AVX3 | \ +- HWY_BASELINE_RVV) ++ (HWY_SCALAR | HWY_BASELINE_WASM | HWY_BASELINE_PPC8 | HWY_BASELINE_SVE2 | \ ++ HWY_BASELINE_SVE | HWY_BASELINE_NEON | HWY_BASELINE_SSE4 | \ ++ HWY_BASELINE_AVX2 | HWY_BASELINE_AVX3 | HWY_BASELINE_RVV) + + #endif // HWY_BASELINE_TARGETS + +@@ -242,13 +269,12 @@ + #define HWY_TARGETS HWY_STATIC_TARGET + + // 3) For tests: include all attainable targets (in particular: scalar) +-#elif defined(HWY_COMPILE_ALL_ATTAINABLE) ++#elif defined(HWY_COMPILE_ALL_ATTAINABLE) || defined(HWY_IS_TEST) + #define HWY_TARGETS HWY_ATTAINABLE_TARGETS + + // 4) Default: attainable WITHOUT non-best baseline. This reduces code size by + // excluding superseded targets, in particular scalar. + #else +- + #define HWY_TARGETS (HWY_ATTAINABLE_TARGETS & (2 * HWY_STATIC_TARGET - 1)) + + #endif // target policy +@@ -323,6 +349,10 @@ static inline HWY_MAYBE_UNUSED const cha + #endif + + #if HWY_ARCH_ARM ++ case HWY_SVE2: ++ return "SVE2"; ++ case HWY_SVE: ++ return "SVE"; + case HWY_NEON: + return "Neon"; + #endif +@@ -346,7 +376,7 @@ static inline HWY_MAYBE_UNUSED const cha + return "Scalar"; + + default: +- return "?"; ++ return "Unknown"; // must satisfy gtest IsValidParamName() + } + } + +@@ -405,21 +435,17 @@ static inline HWY_MAYBE_UNUSED const cha + nullptr, /* SSE3 */ \ + nullptr /* SSE2 */ + +-#endif // HWY_ARCH_X86 +- +-#if HWY_ARCH_ARM ++#elif HWY_ARCH_ARM + // See HWY_ARCH_X86 above for details. + #define HWY_MAX_DYNAMIC_TARGETS 4 + #define HWY_HIGHEST_TARGET_BIT HWY_HIGHEST_TARGET_BIT_ARM + #define HWY_CHOOSE_TARGET_LIST(func_name) \ +- nullptr, /* reserved */ \ +- nullptr, /* reserved */ \ ++ HWY_CHOOSE_SVE2(func_name), /* SVE2 */ \ ++ HWY_CHOOSE_SVE(func_name), /* SVE */ \ + nullptr, /* reserved */ \ + HWY_CHOOSE_NEON(func_name) /* NEON */ + +-#endif // HWY_ARCH_ARM +- +-#if HWY_ARCH_PPC ++#elif HWY_ARCH_PPC + // See HWY_ARCH_X86 above for details. + #define HWY_MAX_DYNAMIC_TARGETS 5 + #define HWY_HIGHEST_TARGET_BIT HWY_HIGHEST_TARGET_BIT_PPC +@@ -430,9 +456,7 @@ static inline HWY_MAYBE_UNUSED const cha + nullptr, /* VSX */ \ + nullptr /* AltiVec */ + +-#endif // HWY_ARCH_PPC +- +-#if HWY_ARCH_WASM ++#elif HWY_ARCH_WASM + // See HWY_ARCH_X86 above for details. + #define HWY_MAX_DYNAMIC_TARGETS 4 + #define HWY_HIGHEST_TARGET_BIT HWY_HIGHEST_TARGET_BIT_WASM +@@ -442,9 +466,7 @@ static inline HWY_MAYBE_UNUSED const cha + nullptr, /* reserved */ \ + HWY_CHOOSE_WASM(func_name) /* WASM */ + +-#endif // HWY_ARCH_WASM +- +-#if HWY_ARCH_RVV ++#elif HWY_ARCH_RVV + // See HWY_ARCH_X86 above for details. + #define HWY_MAX_DYNAMIC_TARGETS 4 + #define HWY_HIGHEST_TARGET_BIT HWY_HIGHEST_TARGET_BIT_RVV +@@ -454,7 +476,12 @@ static inline HWY_MAYBE_UNUSED const cha + nullptr, /* reserved */ \ + HWY_CHOOSE_RVV(func_name) /* RVV */ + +-#endif // HWY_ARCH_RVV ++#else ++// Unknown architecture, will use HWY_SCALAR without dynamic dispatch, though ++// still creating single-entry tables in HWY_EXPORT to ensure portability. ++#define HWY_MAX_DYNAMIC_TARGETS 1 ++#define HWY_HIGHEST_TARGET_BIT HWY_HIGHEST_TARGET_BIT_SCALAR ++#endif + + struct ChosenTarget { + public: +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/targets.hE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/targets.hE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/targets_test.cc.12 chromium-91.0.4472.77/third_party/highway/src/hwy/targets_test.cc +--- chromium-91.0.4472.77/third_party/highway/src/hwy/targets_test.cc.12 2021-06-02 10:56:05.264904539 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/targets_test.cc 2021-05-31 10:37:11.000000000 -0400 +@@ -35,19 +35,19 @@ DECLARE_FUNCTION(SCALAR) + HWY_EXPORT(FakeFunction); + + void CheckFakeFunction() { +-#define CHECK_ARRAY_ENTRY(TGT) \ +- if ((HWY_TARGETS & HWY_##TGT) != 0) { \ +- hwy::SetSupportedTargetsForTest(HWY_##TGT); \ +- /* Calling Update() first to make &HWY_DYNAMIC_DISPATCH() return */ \ +- /* the pointer to the already cached function. */ \ +- hwy::chosen_target.Update(); \ +- EXPECT_EQ(HWY_##TGT, HWY_DYNAMIC_DISPATCH(FakeFunction)(42)); \ +- /* Calling DeInit() will test that the initializer function */ \ +- /* also calls the right function. */ \ +- hwy::chosen_target.DeInit(); \ +- EXPECT_EQ(HWY_##TGT, HWY_DYNAMIC_DISPATCH(FakeFunction)(42)); \ +- /* Second call uses the cached value from the previous call. */ \ +- EXPECT_EQ(HWY_##TGT, HWY_DYNAMIC_DISPATCH(FakeFunction)(42)); \ ++#define CHECK_ARRAY_ENTRY(TGT) \ ++ if ((HWY_TARGETS & HWY_##TGT) != 0) { \ ++ hwy::SetSupportedTargetsForTest(HWY_##TGT); \ ++ /* Calling Update() first to make &HWY_DYNAMIC_DISPATCH() return */ \ ++ /* the pointer to the already cached function. */ \ ++ hwy::chosen_target.Update(); \ ++ EXPECT_EQ(uint32_t(HWY_##TGT), HWY_DYNAMIC_DISPATCH(FakeFunction)(42)); \ ++ /* Calling DeInit() will test that the initializer function */ \ ++ /* also calls the right function. */ \ ++ hwy::chosen_target.DeInit(); \ ++ EXPECT_EQ(uint32_t(HWY_##TGT), HWY_DYNAMIC_DISPATCH(FakeFunction)(42)); \ ++ /* Second call uses the cached value from the previous call. */ \ ++ EXPECT_EQ(uint32_t(HWY_##TGT), HWY_DYNAMIC_DISPATCH(FakeFunction)(42)); \ + } + CHECK_ARRAY_ENTRY(AVX3) + CHECK_ARRAY_ENTRY(AVX2) +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/targets_test.ccE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/targets_test.ccE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/tests/arithmetic_test.cc.12 chromium-91.0.4472.77/third_party/highway/src/hwy/tests/arithmetic_test.cc +--- chromium-91.0.4472.77/third_party/highway/src/hwy/tests/arithmetic_test.cc.12 2021-06-02 10:56:05.251904473 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/tests/arithmetic_test.cc 2021-05-31 10:37:11.000000000 -0400 +@@ -16,7 +16,6 @@ + #include + + #include +-#include + #include + + #undef HWY_TARGET_INCLUDE +@@ -173,16 +172,8 @@ struct TestFloatAbs { + }; + + HWY_NOINLINE void TestAllAbs() { +- const ForPartialVectors test; +- test(int8_t()); +- test(int16_t()); +- test(int32_t()); +- +- const ForPartialVectors test_float; +- test_float(float()); +-#if HWY_CAP_FLOAT64 +- test_float(double()); +-#endif ++ ForSignedTypes(ForPartialVectors()); ++ ForFloatTypes(ForPartialVectors()); + } + + template +@@ -199,6 +190,45 @@ struct TestLeftShifts { + const size_t N = Lanes(d); + auto expected = AllocateAligned(N); + ++ const auto values = Iota(d, kSigned ? -TI(N) : TI(0)); // value to shift ++ constexpr size_t kMaxShift = (sizeof(T) * 8) - 1; ++ ++ // 0 ++ HWY_ASSERT_VEC_EQ(d, values, ShiftLeft<0>(values)); ++ HWY_ASSERT_VEC_EQ(d, values, ShiftLeftSame(values, 0)); ++ ++ // 1 ++ for (size_t i = 0; i < N; ++i) { ++ const T value = kSigned ? T(i) - T(N) : T(i); ++ expected[i] = T(TU(value) << 1); ++ } ++ HWY_ASSERT_VEC_EQ(d, expected.get(), ShiftLeft<1>(values)); ++ HWY_ASSERT_VEC_EQ(d, expected.get(), ShiftLeftSame(values, 1)); ++ ++ // max ++ for (size_t i = 0; i < N; ++i) { ++ const T value = kSigned ? T(i) - T(N) : T(i); ++ expected[i] = T(TU(value) << kMaxShift); ++ } ++ HWY_ASSERT_VEC_EQ(d, expected.get(), ShiftLeft(values)); ++ HWY_ASSERT_VEC_EQ(d, expected.get(), ShiftLeftSame(values, kMaxShift)); ++ } ++}; ++ ++template ++struct TestVariableLeftShifts { ++ template ++ HWY_NOINLINE void operator()(T t, D d) { ++ if (kSigned) { ++ // Also test positive values ++ TestVariableLeftShifts()(t, d); ++ } ++ ++ using TI = MakeSigned; ++ using TU = MakeUnsigned; ++ const size_t N = Lanes(d); ++ auto expected = AllocateAligned(N); ++ + const auto v0 = Zero(d); + const auto v1 = Set(d, 1); + const auto values = Iota(d, kSigned ? -TI(N) : TI(0)); // value to shift +@@ -209,8 +239,6 @@ struct TestLeftShifts { + const auto large_shifts = max_shift - small_shifts; + + // Same: 0 +- HWY_ASSERT_VEC_EQ(d, values, ShiftLeft<0>(values)); +- HWY_ASSERT_VEC_EQ(d, values, ShiftLeftSame(values, 0)); + HWY_ASSERT_VEC_EQ(d, values, Shl(values, v0)); + + // Same: 1 +@@ -218,8 +246,6 @@ struct TestLeftShifts { + const T value = kSigned ? T(i) - T(N) : T(i); + expected[i] = T(TU(value) << 1); + } +- HWY_ASSERT_VEC_EQ(d, expected.get(), ShiftLeft<1>(values)); +- HWY_ASSERT_VEC_EQ(d, expected.get(), ShiftLeftSame(values, 1)); + HWY_ASSERT_VEC_EQ(d, expected.get(), Shl(values, v1)); + + // Same: max +@@ -227,8 +253,6 @@ struct TestLeftShifts { + const T value = kSigned ? T(i) - T(N) : T(i); + expected[i] = T(TU(value) << kMaxShift); + } +- HWY_ASSERT_VEC_EQ(d, expected.get(), ShiftLeft(values)); +- HWY_ASSERT_VEC_EQ(d, expected.get(), ShiftLeftSame(values, kMaxShift)); + HWY_ASSERT_VEC_EQ(d, expected.get(), Shl(values, max_shift)); + + // Variable: small +@@ -252,6 +276,37 @@ struct TestUnsignedRightShifts { + const size_t N = Lanes(d); + auto expected = AllocateAligned(N); + ++ const auto values = Iota(d, 0); ++ ++ const T kMax = LimitsMax(); ++ constexpr size_t kMaxShift = (sizeof(T) * 8) - 1; ++ ++ // Shift by 0 ++ HWY_ASSERT_VEC_EQ(d, values, ShiftRight<0>(values)); ++ HWY_ASSERT_VEC_EQ(d, values, ShiftRightSame(values, 0)); ++ ++ // Shift by 1 ++ for (size_t i = 0; i < N; ++i) { ++ expected[i] = T(T(i & kMax) >> 1); ++ } ++ HWY_ASSERT_VEC_EQ(d, expected.get(), ShiftRight<1>(values)); ++ HWY_ASSERT_VEC_EQ(d, expected.get(), ShiftRightSame(values, 1)); ++ ++ // max ++ for (size_t i = 0; i < N; ++i) { ++ expected[i] = T(T(i & kMax) >> kMaxShift); ++ } ++ HWY_ASSERT_VEC_EQ(d, expected.get(), ShiftRight(values)); ++ HWY_ASSERT_VEC_EQ(d, expected.get(), ShiftRightSame(values, kMaxShift)); ++ } ++}; ++ ++struct TestVariableUnsignedRightShifts { ++ template ++ HWY_NOINLINE void operator()(T /*unused*/, D d) { ++ const size_t N = Lanes(d); ++ auto expected = AllocateAligned(N); ++ + const auto v0 = Zero(d); + const auto v1 = Set(d, 1); + const auto values = Iota(d, 0); +@@ -265,21 +320,15 @@ struct TestUnsignedRightShifts { + const auto large_shifts = max_shift - small_shifts; + + // Same: 0 +- HWY_ASSERT_VEC_EQ(d, values, ShiftRight<0>(values)); +- HWY_ASSERT_VEC_EQ(d, values, ShiftRightSame(values, 0)); + HWY_ASSERT_VEC_EQ(d, values, Shr(values, v0)); + + // Same: 1 + for (size_t i = 0; i < N; ++i) { +- expected[i] = T(i >> 1); ++ expected[i] = T(T(i & kMax) >> 1); + } +- HWY_ASSERT_VEC_EQ(d, expected.get(), ShiftRight<1>(values)); +- HWY_ASSERT_VEC_EQ(d, expected.get(), ShiftRightSame(values, 1)); + HWY_ASSERT_VEC_EQ(d, expected.get(), Shr(values, v1)); + + // Same: max +- HWY_ASSERT_VEC_EQ(d, v0, ShiftRight(values)); +- HWY_ASSERT_VEC_EQ(d, v0, ShiftRightSame(values, kMaxShift)); + HWY_ASSERT_VEC_EQ(d, v0, Shr(values, max_shift)); + + // Variable: small +@@ -296,33 +345,120 @@ struct TestUnsignedRightShifts { + } + }; + +-struct TestSignedRightShifts { ++template ++T RightShiftNegative(T val) { ++ // C++ shifts are implementation-defined for negative numbers, and we have ++ // seen divisions replaced with shifts, so resort to bit operations. ++ using TU = hwy::MakeUnsigned; ++ TU bits; ++ CopyBytes(&val, &bits); ++ ++ const TU shifted = bits >> kAmount; ++ ++ const TU all = ~TU(0); ++ const size_t num_zero = sizeof(TU) * 8 - 1 - kAmount; ++ const TU sign_extended = static_cast((all << num_zero) & LimitsMax()); ++ ++ bits = shifted | sign_extended; ++ CopyBytes(&bits, &val); ++ return val; ++} ++ ++class TestSignedRightShifts { ++ public: + template +- HWY_NOINLINE void operator()(T t, D d) { +- // Also test positive values +- TestUnsignedRightShifts()(t, d); ++ HWY_NOINLINE void operator()(T /*unused*/, D d) { ++ const size_t N = Lanes(d); ++ auto expected = AllocateAligned(N); ++ constexpr T kMin = LimitsMin(); ++ constexpr T kMax = LimitsMax(); ++ constexpr size_t kMaxShift = (sizeof(T) * 8) - 1; ++ ++ // First test positive values, negative are checked below. ++ const auto v0 = Zero(d); ++ const auto values = Iota(d, 0) & Set(d, kMax); ++ ++ // Shift by 0 ++ HWY_ASSERT_VEC_EQ(d, values, ShiftRight<0>(values)); ++ HWY_ASSERT_VEC_EQ(d, values, ShiftRightSame(values, 0)); ++ ++ // Shift by 1 ++ for (size_t i = 0; i < N; ++i) { ++ expected[i] = T(T(i & kMax) >> 1); ++ } ++ HWY_ASSERT_VEC_EQ(d, expected.get(), ShiftRight<1>(values)); ++ HWY_ASSERT_VEC_EQ(d, expected.get(), ShiftRightSame(values, 1)); ++ ++ // max ++ HWY_ASSERT_VEC_EQ(d, v0, ShiftRight(values)); ++ HWY_ASSERT_VEC_EQ(d, v0, ShiftRightSame(values, kMaxShift)); ++ ++ // Even negative value ++ Test<0>(kMin, d, __LINE__); ++ Test<1>(kMin, d, __LINE__); ++ Test<2>(kMin, d, __LINE__); ++ Test(kMin, d, __LINE__); ++ ++ const T odd = static_cast(kMin + 1); ++ Test<0>(odd, d, __LINE__); ++ Test<1>(odd, d, __LINE__); ++ Test<2>(odd, d, __LINE__); ++ Test(odd, d, __LINE__); ++ } ++ ++ private: ++ template ++ void Test(T val, D d, int line) { ++ const auto expected = Set(d, RightShiftNegative(val)); ++ const auto in = Set(d, val); ++ const char* file = __FILE__; ++ AssertVecEqual(d, expected, ShiftRight(in), file, line); ++ AssertVecEqual(d, expected, ShiftRightSame(in, kAmount), file, line); ++ } ++}; + ++struct TestVariableSignedRightShifts { ++ template ++ HWY_NOINLINE void operator()(T /*unused*/, D d) { + using TU = MakeUnsigned; + const size_t N = Lanes(d); + auto expected = AllocateAligned(N); + + constexpr T kMin = LimitsMin(); +- const auto values = Iota(d, kMin); ++ constexpr T kMax = LimitsMax(); + + constexpr size_t kMaxShift = (sizeof(T) * 8) - 1; ++ ++ // First test positive values, negative are checked below. ++ const auto v0 = Zero(d); ++ const auto positive = Iota(d, 0) & Set(d, kMax); ++ ++ // Shift by 0 ++ HWY_ASSERT_VEC_EQ(d, positive, ShiftRight<0>(positive)); ++ HWY_ASSERT_VEC_EQ(d, positive, ShiftRightSame(positive, 0)); ++ ++ // Shift by 1 ++ for (size_t i = 0; i < N; ++i) { ++ expected[i] = T(T(i & kMax) >> 1); ++ } ++ HWY_ASSERT_VEC_EQ(d, expected.get(), ShiftRight<1>(positive)); ++ HWY_ASSERT_VEC_EQ(d, expected.get(), ShiftRightSame(positive, 1)); ++ ++ // max ++ HWY_ASSERT_VEC_EQ(d, v0, ShiftRight(positive)); ++ HWY_ASSERT_VEC_EQ(d, v0, ShiftRightSame(positive, kMaxShift)); ++ + const auto max_shift = Set(d, kMaxShift); + const auto small_shifts = And(Iota(d, 0), max_shift); + const auto large_shifts = max_shift - small_shifts; + +- // Test varying values to shift ++ const auto negative = Iota(d, kMin); ++ ++ // Test varying negative to shift + for (size_t i = 0; i < N; ++i) { +- // We want a right-shift here, which is undefined behavior for negative +- // numbers. Since we want (-1)>>1 to be -1, we need to adjust rounding if +- // minT is odd and negative. +- T minT = static_cast(kMin + i); +- expected[i] = T(minT / 2 + (minT < 0 ? minT % 2 : 0)); ++ expected[i] = RightShiftNegative<1>(static_cast(kMin + i)); + } +- HWY_ASSERT_VEC_EQ(d, expected.get(), Shr(values, Set(d, 1))); ++ HWY_ASSERT_VEC_EQ(d, expected.get(), Shr(negative, Set(d, 1))); + + // Shift MSB right by small amounts + for (size_t i = 0; i < N; ++i) { +@@ -343,6 +479,13 @@ struct TestSignedRightShifts { + }; + + HWY_NOINLINE void TestAllShifts() { ++ ForUnsignedTypes(ForPartialVectors>()); ++ ForSignedTypes(ForPartialVectors>()); ++ ForUnsignedTypes(ForPartialVectors()); ++ ForSignedTypes(ForPartialVectors()); ++} ++ ++HWY_NOINLINE void TestAllVariableShifts() { + const ForPartialVectors> shl_u; + const ForPartialVectors> shl_s; + const ForPartialVectors shr_u; +@@ -821,6 +964,40 @@ HWY_NOINLINE void TestAllRound() { + ForFloatTypes(ForPartialVectors()); + } + ++struct TestNearestInt { ++ template ++ HWY_NOINLINE void operator()(TF tf, const DF df) { ++ using TI = MakeSigned; ++ const RebindToSigned di; ++ ++ size_t padded; ++ auto in = RoundTestCases(tf, df, padded); ++ auto expected = AllocateAligned(padded); ++ ++ constexpr double max = static_cast(LimitsMax()); ++ for (size_t i = 0; i < padded; ++i) { ++ if (std::isnan(in[i])) { ++ // We replace NaN with 0 below (no_nan) ++ expected[i] = 0; ++ } else if (std::isinf(in[i]) || double(std::abs(in[i])) >= max) { ++ // Avoid undefined result for lrintf ++ expected[i] = std::signbit(in[i]) ? LimitsMin() : LimitsMax(); ++ } else { ++ expected[i] = lrintf(in[i]); ++ } ++ } ++ for (size_t i = 0; i < padded; i += Lanes(df)) { ++ const auto v = Load(df, &in[i]); ++ const auto no_nan = IfThenElse(Eq(v, v), v, Zero(df)); ++ HWY_ASSERT_VEC_EQ(di, &expected[i], NearestInt(no_nan)); ++ } ++ } ++}; ++ ++HWY_NOINLINE void TestAllNearestInt() { ++ ForPartialVectors()(float()); ++} ++ + struct TestTrunc { + template + HWY_NOINLINE void operator()(T t, D d) { +@@ -909,8 +1086,7 @@ struct TestSumOfLanes { + }; + + HWY_NOINLINE void TestAllSumOfLanes() { +- // Only full vectors because lanes in partial vectors are undefined. +- const ForFullVectors sum; ++ const ForPartialVectors sum; + + // No u8/u16/i8/i16. + sum(uint32_t()); +@@ -976,9 +1152,8 @@ struct TestMaxOfLanes { + }; + + HWY_NOINLINE void TestAllMinMaxOfLanes() { +- // Only full vectors because lanes in partial vectors are undefined. +- const ForFullVectors min; +- const ForFullVectors max; ++ const ForPartialVectors min; ++ const ForPartialVectors max; + + // No u8/u16/i8/i16. + min(uint32_t()); +@@ -1044,10 +1219,12 @@ HWY_NOINLINE void TestAllNeg() { + HWY_AFTER_NAMESPACE(); + + #if HWY_ONCE ++namespace hwy { + HWY_BEFORE_TEST(HwyArithmeticTest); + HWY_EXPORT_AND_TEST_P(HwyArithmeticTest, TestAllPlusMinus); + HWY_EXPORT_AND_TEST_P(HwyArithmeticTest, TestAllSaturatingArithmetic); + HWY_EXPORT_AND_TEST_P(HwyArithmeticTest, TestAllShifts); ++HWY_EXPORT_AND_TEST_P(HwyArithmeticTest, TestAllVariableShifts); + HWY_EXPORT_AND_TEST_P(HwyArithmeticTest, TestAllMinMax); + HWY_EXPORT_AND_TEST_P(HwyArithmeticTest, TestAllAverage); + HWY_EXPORT_AND_TEST_P(HwyArithmeticTest, TestAllAbs); +@@ -1062,10 +1239,11 @@ HWY_EXPORT_AND_TEST_P(HwyArithmeticTest, + HWY_EXPORT_AND_TEST_P(HwyArithmeticTest, TestAllSumOfLanes); + HWY_EXPORT_AND_TEST_P(HwyArithmeticTest, TestAllMinMaxOfLanes); + HWY_EXPORT_AND_TEST_P(HwyArithmeticTest, TestAllRound); ++HWY_EXPORT_AND_TEST_P(HwyArithmeticTest, TestAllNearestInt); + HWY_EXPORT_AND_TEST_P(HwyArithmeticTest, TestAllTrunc); + HWY_EXPORT_AND_TEST_P(HwyArithmeticTest, TestAllCeil); + HWY_EXPORT_AND_TEST_P(HwyArithmeticTest, TestAllFloor); + HWY_EXPORT_AND_TEST_P(HwyArithmeticTest, TestAllAbsDiff); + HWY_EXPORT_AND_TEST_P(HwyArithmeticTest, TestAllNeg); +-HWY_AFTER_TEST(); ++} // namespace hwy + #endif +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/tests/arithmetic_test.ccE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/tests/arithmetic_test.ccE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/tests/combine_test.cc.12 chromium-91.0.4472.77/third_party/highway/src/hwy/tests/combine_test.cc +--- chromium-91.0.4472.77/third_party/highway/src/hwy/tests/combine_test.cc.12 2021-06-02 10:56:05.252904478 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/tests/combine_test.cc 2021-05-31 10:37:11.000000000 -0400 +@@ -272,13 +272,14 @@ HWY_NOINLINE void TestAllCombineShiftRig + HWY_AFTER_NAMESPACE(); + + #if HWY_ONCE ++namespace hwy { + HWY_BEFORE_TEST(HwyCombineTest); + HWY_EXPORT_AND_TEST_P(HwyCombineTest, TestAllLowerHalf); + HWY_EXPORT_AND_TEST_P(HwyCombineTest, TestAllUpperHalf); + HWY_EXPORT_AND_TEST_P(HwyCombineTest, TestAllZeroExtendVector); + HWY_EXPORT_AND_TEST_P(HwyCombineTest, TestAllCombine); + HWY_EXPORT_AND_TEST_P(HwyCombineTest, TestAllCombineShiftRight); +-HWY_AFTER_TEST(); ++} // namespace hwy + #endif + + #else +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/tests/combine_test.ccE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/tests/combine_test.ccE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/tests/compare_test.cc.12 chromium-91.0.4472.77/third_party/highway/src/hwy/tests/compare_test.cc +--- chromium-91.0.4472.77/third_party/highway/src/hwy/tests/compare_test.cc.12 2021-06-02 10:56:05.249904463 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/tests/compare_test.cc 2021-05-31 10:37:11.000000000 -0400 +@@ -206,11 +206,12 @@ HWY_NOINLINE void TestAllWeakFloat() { + HWY_AFTER_NAMESPACE(); + + #if HWY_ONCE ++namespace hwy { + HWY_BEFORE_TEST(HwyCompareTest); + HWY_EXPORT_AND_TEST_P(HwyCompareTest, TestAllMask); + HWY_EXPORT_AND_TEST_P(HwyCompareTest, TestAllEquality); + HWY_EXPORT_AND_TEST_P(HwyCompareTest, TestAllStrictInt); + HWY_EXPORT_AND_TEST_P(HwyCompareTest, TestAllStrictFloat); + HWY_EXPORT_AND_TEST_P(HwyCompareTest, TestAllWeakFloat); +-HWY_AFTER_TEST(); ++} // namespace hwy + #endif +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/tests/compare_test.ccE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/tests/compare_test.ccE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/tests/convert_test.cc.12 chromium-91.0.4472.77/third_party/highway/src/hwy/tests/convert_test.cc +--- chromium-91.0.4472.77/third_party/highway/src/hwy/tests/convert_test.cc.12 2021-06-02 10:56:05.261904523 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/tests/convert_test.cc 2021-05-31 10:37:11.000000000 -0400 +@@ -16,8 +16,6 @@ + #include + #include + +-#include +- + #undef HWY_TARGET_INCLUDE + #define HWY_TARGET_INCLUDE "tests/convert_test.cc" + #include "hwy/foreach_target.h" +@@ -547,37 +545,6 @@ HWY_NOINLINE void TestAllI32F64() { + #endif + } + +-struct TestNearestInt { +- template +- HWY_NOINLINE void operator()(TI /*unused*/, const DI di) { +- using TF = MakeFloat; +- const Rebind df; +- const size_t N = Lanes(df); +- +- // Integer positive +- HWY_ASSERT_VEC_EQ(di, Iota(di, 4), NearestInt(Iota(df, 4.0f))); +- +- // Integer negative +- HWY_ASSERT_VEC_EQ(di, Iota(di, -32), NearestInt(Iota(df, -32.0f))); +- +- // Above positive +- HWY_ASSERT_VEC_EQ(di, Iota(di, 2), NearestInt(Iota(df, 2.001f))); +- +- // Below positive +- HWY_ASSERT_VEC_EQ(di, Iota(di, 4), NearestInt(Iota(df, 3.9999f))); +- +- const TF eps = static_cast(0.0001); +- // Above negative +- HWY_ASSERT_VEC_EQ(di, Iota(di, -TI(N)), NearestInt(Iota(df, -TF(N) + eps))); +- +- // Below negative +- HWY_ASSERT_VEC_EQ(di, Iota(di, -TI(N)), NearestInt(Iota(df, -TF(N) - eps))); +- } +-}; +- +-HWY_NOINLINE void TestAllNearestInt() { +- ForPartialVectors()(int32_t()); +-} + + // NOLINTNEXTLINE(google-readability-namespace-comments) + } // namespace HWY_NAMESPACE +@@ -585,6 +552,7 @@ HWY_NOINLINE void TestAllNearestInt() { + HWY_AFTER_NAMESPACE(); + + #if HWY_ONCE ++namespace hwy { + HWY_BEFORE_TEST(HwyConvertTest); + HWY_EXPORT_AND_TEST_P(HwyConvertTest, TestAllBitCast); + HWY_EXPORT_AND_TEST_P(HwyConvertTest, TestAllPromoteTo); +@@ -596,6 +564,5 @@ HWY_EXPORT_AND_TEST_P(HwyConvertTest, Te + HWY_EXPORT_AND_TEST_P(HwyConvertTest, TestAllIntFromFloat); + HWY_EXPORT_AND_TEST_P(HwyConvertTest, TestAllFloatFromInt); + HWY_EXPORT_AND_TEST_P(HwyConvertTest, TestAllI32F64); +-HWY_EXPORT_AND_TEST_P(HwyConvertTest, TestAllNearestInt); +-HWY_AFTER_TEST(); ++} // namespace hwy + #endif +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/tests/convert_test.ccE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/tests/convert_test.ccE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/tests/hwy_test.cc.12 chromium-91.0.4472.77/third_party/highway/src/hwy/tests/hwy_test.cc +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/tests/hwy_test.ccE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/tests/hwy_test.ccE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/tests/list_targets.cc.12 chromium-91.0.4472.77/third_party/highway/src/hwy/tests/list_targets.cc +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/tests/list_targets.ccE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/tests/list_targets.ccE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/tests/logical_test.cc.12 chromium-91.0.4472.77/third_party/highway/src/hwy/tests/logical_test.cc +--- chromium-91.0.4472.77/third_party/highway/src/hwy/tests/logical_test.cc.12 2021-06-02 10:56:05.245904442 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/tests/logical_test.cc 2021-05-31 10:37:11.000000000 -0400 +@@ -14,6 +14,7 @@ + + #include + #include ++#include // memcmp + + #include "hwy/base.h" + +@@ -159,6 +160,30 @@ HWY_NOINLINE void TestAllCopySign() { + ForFloatTypes(ForPartialVectors()); + } + ++struct TestFirstN { ++ template ++ HWY_NOINLINE void operator()(T /*unused*/, D d) { ++ const size_t N = Lanes(d); ++ auto mask_lanes = AllocateAligned(N); ++ ++ // NOTE: reverse polarity (mask is true iff mask_lanes[i] == 0) because we ++ // cannot reliably compare against all bits set (NaN for float types). ++ const T off = 1; ++ ++ for (size_t len = 0; len <= N; ++len) { ++ for (size_t i = 0; i < N; ++i) { ++ mask_lanes[i] = i < len ? T(0) : off; ++ } ++ const auto mask = Eq(Load(d, mask_lanes.get()), Zero(d)); ++ HWY_ASSERT_MASK_EQ(d, mask, FirstN(d, len)); ++ } ++ } ++}; ++ ++HWY_NOINLINE void TestAllFirstN() { ++ ForAllTypes(ForPartialVectors()); ++} ++ + struct TestIfThenElse { + template + HWY_NOINLINE void operator()(T /*unused*/, D d) { +@@ -208,15 +233,56 @@ HWY_NOINLINE void TestAllIfThenElse() { + ForAllTypes(ForPartialVectors()); + } + +-// Also tests MaskFromVec/VecFromMask ++struct TestMaskVec { ++ template ++ HWY_NOINLINE void operator()(T /*unused*/, D d) { ++ RandomState rng; ++ ++ const size_t N = Lanes(d); ++ auto mask_lanes = AllocateAligned(N); ++ ++ // Each lane should have a chance of having mask=true. ++ for (size_t rep = 0; rep < 100; ++rep) { ++ for (size_t i = 0; i < N; ++i) { ++ mask_lanes[i] = static_cast(Random32(&rng) & 1); ++ } ++ ++ const auto mask = RebindMask(d, Eq(Load(d, mask_lanes.get()), Zero(d))); ++ HWY_ASSERT_MASK_EQ(d, mask, MaskFromVec(VecFromMask(d, mask))); ++ } ++ } ++}; ++ ++HWY_NOINLINE void TestAllMaskVec() { ++ const ForPartialVectors test; ++ ++ test(uint16_t()); ++ test(int16_t()); ++ // TODO(janwas): float16_t - cannot compare yet ++ ++ test(uint32_t()); ++ test(int32_t()); ++ test(float()); ++ ++#if HWY_CAP_INTEGER64 ++ test(uint64_t()); ++ test(int64_t()); ++#endif ++#if HWY_CAP_FLOAT64 ++ test(double()); ++#endif ++} ++ + struct TestCompress { + template + HWY_NOINLINE void operator()(T /*unused*/, D d) { + RandomState rng; + ++ using TU = MakeUnsigned; ++ const Rebind du; + const size_t N = Lanes(d); + auto in_lanes = AllocateAligned(N); +- auto mask_lanes = AllocateAligned(N); ++ auto mask_lanes = AllocateAligned(N); + auto expected = AllocateAligned(N); + auto actual = AllocateAligned(N); + +@@ -224,35 +290,56 @@ struct TestCompress { + for (size_t rep = 0; rep < 100; ++rep) { + size_t expected_pos = 0; + for (size_t i = 0; i < N; ++i) { +- in_lanes[i] = static_cast(Random32(&rng)); +- mask_lanes[i] = static_cast(Random32(&rng) & 1); ++ const uint64_t bits = Random32(&rng); ++ in_lanes[i] = T(); // cannot initialize float16_t directly. ++ CopyBytes(&bits, &in_lanes[i]); ++ mask_lanes[i] = static_cast(Random32(&rng) & 1); + if (mask_lanes[i] == 0) { // Zero means true (easier to compare) + expected[expected_pos++] = in_lanes[i]; + } + } + + const auto in = Load(d, in_lanes.get()); +- const auto mask = Eq(Load(d, mask_lanes.get()), Zero(d)); ++ const auto mask = RebindMask(d, Eq(Load(du, mask_lanes.get()), Zero(du))); + +- HWY_ASSERT_MASK_EQ(d, mask, MaskFromVec(VecFromMask(d, mask))); + Store(Compress(in, mask), d, actual.get()); + // Upper lanes are undefined. + for (size_t i = 0; i < expected_pos; ++i) { +- HWY_ASSERT(actual[i] == expected[i]); ++ HWY_ASSERT(memcmp(&actual[i], &expected[i], sizeof(T)) == 0); + } + + // Also check CompressStore in the same way. +- std::fill(actual.get(), actual.get() + N, T(0)); ++ memset(actual.get(), 0, N * sizeof(T)); + const size_t num_written = CompressStore(in, mask, d, actual.get()); + HWY_ASSERT_EQ(expected_pos, num_written); + for (size_t i = 0; i < expected_pos; ++i) { +- HWY_ASSERT_EQ(expected[i], actual[i]); ++ HWY_ASSERT(memcmp(&actual[i], &expected[i], sizeof(T)) == 0); + } + } + } + }; + + #if 0 ++namespace detail { // for code folding ++void PrintCompress16x8Tables() { ++ constexpr size_t N = 8; // 128-bit SIMD ++ for (uint64_t code = 0; code < 1ull << N; ++code) { ++ std::array indices{0}; ++ size_t pos = 0; ++ for (size_t i = 0; i < N; ++i) { ++ if (code & (1ull << i)) { ++ indices[pos++] = i; ++ } ++ } ++ ++ // Doubled (for converting lane to byte indices) ++ for (size_t i = 0; i < N; ++i) { ++ printf("%d,", 2 * indices[i]); ++ } ++ } ++ printf("\n"); ++} ++ + // Compressed to nibbles + void PrintCompress32x8Tables() { + constexpr size_t N = 8; // AVX2 +@@ -340,16 +427,22 @@ void PrintCompress64x2Tables() { + } + printf("\n"); + } +- ++} // namespace detail + #endif + + HWY_NOINLINE void TestAllCompress() { +- // PrintCompress32x8Tables(); +- // PrintCompress64x4Tables(); +- // PrintCompress32x4Tables(); +- // PrintCompress64x2Tables(); ++ // detail::PrintCompress32x8Tables(); ++ // detail::PrintCompress64x4Tables(); ++ // detail::PrintCompress32x4Tables(); ++ // detail::PrintCompress64x2Tables(); ++ // detail::PrintCompress16x8Tables(); + + const ForPartialVectors test; ++ ++ test(uint16_t()); ++ test(int16_t()); ++ test(float16_t()); ++ + test(uint32_t()); + test(int32_t()); + test(float()); +@@ -358,7 +451,6 @@ HWY_NOINLINE void TestAllCompress() { + test(uint64_t()); + test(int64_t()); + #endif +- + #if HWY_CAP_FLOAT64 + test(double()); + #endif +@@ -432,7 +524,7 @@ struct TestTestBit { + }; + + HWY_NOINLINE void TestAllTestBit() { +- ForIntegerTypes(ForFullVectors()); ++ ForIntegerTypes(ForPartialVectors()); + } + + struct TestAllTrueFalse { +@@ -445,6 +537,8 @@ struct TestAllTrueFalse { + auto lanes = AllocateAligned(N); + std::fill(lanes.get(), lanes.get() + N, T(0)); + ++ auto mask_lanes = AllocateAligned(N); ++ + HWY_ASSERT(AllTrue(Eq(v, zero))); + HWY_ASSERT(!AllFalse(Eq(v, zero))); + +@@ -456,7 +550,13 @@ struct TestAllTrueFalse { + for (size_t i = 0; i < N; ++i) { + lanes[i] = T(1); + v = Load(d, lanes.get()); +- HWY_ASSERT(!AllTrue(Eq(v, zero))); ++ ++ // GCC 10.2.1 workaround: AllTrue(Eq(v, zero)) is true but should not be. ++ // Assigning to an lvalue is insufficient but storing to memory prevents ++ // the bug; so does Print of VecFromMask(d, Eq(v, zero)). ++ Store(VecFromMask(d, Eq(v, zero)), d, mask_lanes.get()); ++ HWY_ASSERT(!AllTrue(MaskFromVec(Load(d, mask_lanes.get())))); ++ + HWY_ASSERT(expected_all_false ^ AllFalse(Eq(v, zero))); + + lanes[i] = T(-1); +@@ -596,7 +696,7 @@ struct TestLogicalMask { + }; + + HWY_NOINLINE void TestAllLogicalMask() { +- ForAllTypes(ForFullVectors()); ++ ForAllTypes(ForPartialVectors()); + } + // NOLINTNEXTLINE(google-readability-namespace-comments) + } // namespace HWY_NAMESPACE +@@ -604,11 +704,14 @@ HWY_NOINLINE void TestAllLogicalMask() { + HWY_AFTER_NAMESPACE(); + + #if HWY_ONCE ++namespace hwy { + HWY_BEFORE_TEST(HwyLogicalTest); + HWY_EXPORT_AND_TEST_P(HwyLogicalTest, TestAllLogicalInteger); + HWY_EXPORT_AND_TEST_P(HwyLogicalTest, TestAllLogicalFloat); + HWY_EXPORT_AND_TEST_P(HwyLogicalTest, TestAllCopySign); ++HWY_EXPORT_AND_TEST_P(HwyLogicalTest, TestAllFirstN); + HWY_EXPORT_AND_TEST_P(HwyLogicalTest, TestAllIfThenElse); ++HWY_EXPORT_AND_TEST_P(HwyLogicalTest, TestAllMaskVec); + HWY_EXPORT_AND_TEST_P(HwyLogicalTest, TestAllCompress); + HWY_EXPORT_AND_TEST_P(HwyLogicalTest, TestAllZeroIfNegative); + HWY_EXPORT_AND_TEST_P(HwyLogicalTest, TestAllBroadcastSignBit); +@@ -617,5 +720,5 @@ HWY_EXPORT_AND_TEST_P(HwyLogicalTest, Te + HWY_EXPORT_AND_TEST_P(HwyLogicalTest, TestAllStoreMaskBits); + HWY_EXPORT_AND_TEST_P(HwyLogicalTest, TestAllCountTrue); + HWY_EXPORT_AND_TEST_P(HwyLogicalTest, TestAllLogicalMask); +-HWY_AFTER_TEST(); ++} // namespace hwy + #endif +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/tests/logical_test.ccE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/tests/logical_test.ccE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/tests/memory_test.cc.12 chromium-91.0.4472.77/third_party/highway/src/hwy/tests/memory_test.cc +--- chromium-91.0.4472.77/third_party/highway/src/hwy/tests/memory_test.cc.12 2021-06-02 10:56:05.247904453 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/tests/memory_test.cc 2021-05-31 10:37:11.000000000 -0400 +@@ -12,6 +12,12 @@ + // See the License for the specific language governing permissions and + // limitations under the License. + ++// Ensure incompabilities with Windows macros (e.g. #define StoreFence) are ++// detected. Must come before Highway headers. ++#if defined(_WIN32) || defined(_WIN64) ++#include ++#endif ++ + #include + #include + +@@ -76,6 +82,119 @@ HWY_NOINLINE void TestAllLoadStore() { + ForAllTypes(ForPartialVectors()); + } + ++struct TestStoreInterleaved3 { ++ template ++ HWY_NOINLINE void operator()(T /*unused*/, D d) { ++ const size_t N = Lanes(d); ++ ++ RandomState rng; ++ ++ // Data to be interleaved ++ auto bytes = AllocateAligned(3 * N); ++ for (size_t i = 0; i < 3 * N; ++i) { ++ bytes[i] = static_cast(Random32(&rng) & 0xFF); ++ } ++ const auto in0 = Load(d, &bytes[0 * N]); ++ const auto in1 = Load(d, &bytes[1 * N]); ++ const auto in2 = Load(d, &bytes[2 * N]); ++ ++ // Interleave here, ensure vector results match scalar ++ auto expected = AllocateAligned(4 * N); ++ auto actual_aligned = AllocateAligned(4 * N + 1); ++ T* actual = actual_aligned.get() + 1; ++ ++ for (size_t rep = 0; rep < 100; ++rep) { ++ for (size_t i = 0; i < N; ++i) { ++ expected[3 * i + 0] = bytes[0 * N + i]; ++ expected[3 * i + 1] = bytes[1 * N + i]; ++ expected[3 * i + 2] = bytes[2 * N + i]; ++ // Ensure we do not write more than 3*N bytes ++ expected[3 * N + i] = actual[3 * N + i] = 0; ++ } ++ StoreInterleaved3(in0, in1, in2, d, actual); ++ size_t pos = 0; ++ if (!BytesEqual(expected.get(), actual, 4 * N, &pos)) { ++ Print(d, "in0", in0, pos / 3); ++ Print(d, "in1", in1, pos / 3); ++ Print(d, "in2", in2, pos / 3); ++ const size_t i = pos - pos % 3; ++ fprintf(stderr, "interleaved %d %d %d %d %d %d\n", actual[i], ++ actual[i + 1], actual[i + 2], actual[i + 3], actual[i + 4], ++ actual[i + 5]); ++ HWY_ASSERT(false); ++ } ++ } ++ } ++}; ++ ++HWY_NOINLINE void TestAllStoreInterleaved3() { ++#if HWY_TARGET == HWY_RVV ++ // Segments are limited to 8 registers, so we can only go up to LMUL=2. ++ const ForExtendableVectors test; ++#else ++ const ForPartialVectors test; ++#endif ++ test(uint8_t()); ++} ++ ++struct TestStoreInterleaved4 { ++ template ++ HWY_NOINLINE void operator()(T /*unused*/, D d) { ++ const size_t N = Lanes(d); ++ ++ RandomState rng; ++ ++ // Data to be interleaved ++ auto bytes = AllocateAligned(4 * N); ++ for (size_t i = 0; i < 4 * N; ++i) { ++ bytes[i] = static_cast(Random32(&rng) & 0xFF); ++ } ++ const auto in0 = Load(d, &bytes[0 * N]); ++ const auto in1 = Load(d, &bytes[1 * N]); ++ const auto in2 = Load(d, &bytes[2 * N]); ++ const auto in3 = Load(d, &bytes[3 * N]); ++ ++ // Interleave here, ensure vector results match scalar ++ auto expected = AllocateAligned(5 * N); ++ auto actual_aligned = AllocateAligned(5 * N + 1); ++ T* actual = actual_aligned.get() + 1; ++ ++ for (size_t rep = 0; rep < 100; ++rep) { ++ for (size_t i = 0; i < N; ++i) { ++ expected[4 * i + 0] = bytes[0 * N + i]; ++ expected[4 * i + 1] = bytes[1 * N + i]; ++ expected[4 * i + 2] = bytes[2 * N + i]; ++ expected[4 * i + 3] = bytes[3 * N + i]; ++ // Ensure we do not write more than 4*N bytes ++ expected[4 * N + i] = actual[4 * N + i] = 0; ++ } ++ StoreInterleaved4(in0, in1, in2, in3, d, actual); ++ size_t pos = 0; ++ if (!BytesEqual(expected.get(), actual, 5 * N, &pos)) { ++ Print(d, "in0", in0, pos / 4); ++ Print(d, "in1", in1, pos / 4); ++ Print(d, "in2", in2, pos / 4); ++ Print(d, "in3", in3, pos / 4); ++ const size_t i = pos; ++ fprintf(stderr, "interleaved %d %d %d %d %d %d %d %d\n", actual[i], ++ actual[i + 1], actual[i + 2], actual[i + 3], actual[i + 4], ++ actual[i + 5], actual[i + 6], actual[i + 7]); ++ HWY_ASSERT(false); ++ } ++ } ++ } ++}; ++ ++HWY_NOINLINE void TestAllStoreInterleaved4() { ++#if HWY_TARGET == HWY_RVV ++ // Segments are limited to 8 registers, so we can only go up to LMUL=2. ++ const ForExtendableVectors test; ++#else ++ const ForPartialVectors test; ++#endif ++ test(uint8_t()); ++} ++ + struct TestLoadDup128 { + template + HWY_NOINLINE void operator()(T /*unused*/, D d) { +@@ -86,13 +205,14 @@ struct TestLoadDup128 { + for (size_t i = 0; i < N128; ++i) { + lanes[i] = static_cast(1 + i); + } +- const auto v = LoadDup128(d, lanes); ++ + const size_t N = Lanes(d); +- auto out = AllocateAligned(N); +- Store(v, d, out.get()); ++ auto expected = AllocateAligned(N); + for (size_t i = 0; i < N; ++i) { +- HWY_ASSERT_EQ(T(i % N128 + 1), out[i]); ++ expected[i] = static_cast(i % N128 + 1); + } ++ ++ HWY_ASSERT_VEC_EQ(d, expected.get(), LoadDup128(d, lanes)); + #else + (void)d; + #endif +@@ -136,6 +256,84 @@ HWY_NOINLINE void TestAllStream() { + ForFloatTypes(test); + } + ++// Assumes little-endian byte order! ++struct TestScatter { ++ template ++ HWY_NOINLINE void operator()(T /*unused*/, D d) { ++ using Offset = MakeSigned; ++ ++ const size_t N = Lanes(d); ++ const size_t range = 4 * N; // number of items to scatter ++ const size_t max_bytes = range * sizeof(T); // upper bound on offset ++ ++ RandomState rng; ++ ++ // Data to be scattered ++ auto bytes = AllocateAligned(max_bytes); ++ for (size_t i = 0; i < max_bytes; ++i) { ++ bytes[i] = static_cast(Random32(&rng) & 0xFF); ++ } ++ const auto data = Load(d, reinterpret_cast(bytes.get())); ++ ++ // Scatter into these regions, ensure vector results match scalar ++ auto expected = AllocateAligned(range); ++ auto actual = AllocateAligned(range); ++ ++ const Rebind d_offsets; ++ auto offsets = AllocateAligned(N); // or indices ++ ++ for (size_t rep = 0; rep < 100; ++rep) { ++ // Byte offsets ++ std::fill(expected.get(), expected.get() + range, T(0)); ++ std::fill(actual.get(), actual.get() + range, T(0)); ++ for (size_t i = 0; i < N; ++i) { ++ offsets[i] = ++ static_cast(Random32(&rng) % (max_bytes - sizeof(T))); ++ CopyBytes( ++ bytes.get() + i * sizeof(T), ++ reinterpret_cast(expected.get()) + offsets[i]); ++ } ++ const auto voffsets = Load(d_offsets, offsets.get()); ++ ScatterOffset(data, d, actual.get(), voffsets); ++ if (!BytesEqual(expected.get(), actual.get(), max_bytes)) { ++ Print(d, "Data", data); ++ Print(d_offsets, "Offsets", voffsets); ++ HWY_ASSERT(false); ++ } ++ ++ // Indices ++ std::fill(expected.get(), expected.get() + range, T(0)); ++ std::fill(actual.get(), actual.get() + range, T(0)); ++ for (size_t i = 0; i < N; ++i) { ++ offsets[i] = static_cast(Random32(&rng) % range); ++ CopyBytes(bytes.get() + i * sizeof(T), ++ &expected[offsets[i]]); ++ } ++ const auto vindices = Load(d_offsets, offsets.get()); ++ ScatterIndex(data, d, actual.get(), vindices); ++ if (!BytesEqual(expected.get(), actual.get(), max_bytes)) { ++ Print(d, "Data", data); ++ Print(d_offsets, "Indices", vindices); ++ HWY_ASSERT(false); ++ } ++ } ++ } ++}; ++ ++HWY_NOINLINE void TestAllScatter() { ++ // No u8,u16,i8,i16. ++ const ForPartialVectors test; ++ test(uint32_t()); ++ test(int32_t()); ++ ++#if HWY_CAP_INTEGER64 ++ test(uint64_t()); ++ test(int64_t()); ++#endif ++ ++ ForFloatTypes(test); ++} ++ + struct TestGather { + template + HWY_NOINLINE void operator()(T /*unused*/, D d) { +@@ -183,21 +381,15 @@ struct TestGather { + + HWY_NOINLINE void TestAllGather() { + // No u8,u16,i8,i16. +- const ForPartialVectors test32; +- test32(uint32_t()); +- test32(int32_t()); ++ const ForPartialVectors test; ++ test(uint32_t()); ++ test(int32_t()); + + #if HWY_CAP_INTEGER64 +- const ForPartialVectors test64; +- test64(uint64_t()); +- test64(int64_t()); +-#endif +- +- ForPartialVectors()(float()); +- +-#if HWY_CAP_FLOAT64 +- ForPartialVectors()(double()); ++ test(uint64_t()); ++ test(int64_t()); + #endif ++ ForFloatTypes(test); + } + + HWY_NOINLINE void TestAllCache() { +@@ -206,6 +398,7 @@ HWY_NOINLINE void TestAllCache() { + int test = 0; + Prefetch(&test); + FlushCacheline(&test); ++ Pause(); + } + + // NOLINTNEXTLINE(google-readability-namespace-comments) +@@ -214,11 +407,15 @@ HWY_NOINLINE void TestAllCache() { + HWY_AFTER_NAMESPACE(); + + #if HWY_ONCE ++namespace hwy { + HWY_BEFORE_TEST(HwyMemoryTest); + HWY_EXPORT_AND_TEST_P(HwyMemoryTest, TestAllLoadStore); ++HWY_EXPORT_AND_TEST_P(HwyMemoryTest, TestAllStoreInterleaved3); ++HWY_EXPORT_AND_TEST_P(HwyMemoryTest, TestAllStoreInterleaved4); + HWY_EXPORT_AND_TEST_P(HwyMemoryTest, TestAllLoadDup128); + HWY_EXPORT_AND_TEST_P(HwyMemoryTest, TestAllStream); ++HWY_EXPORT_AND_TEST_P(HwyMemoryTest, TestAllScatter); + HWY_EXPORT_AND_TEST_P(HwyMemoryTest, TestAllGather); + HWY_EXPORT_AND_TEST_P(HwyMemoryTest, TestAllCache); +-HWY_AFTER_TEST(); ++} // namespace hwy + #endif +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/tests/memory_test.ccE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/tests/memory_test.ccE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/tests/swizzle_test.cc.12 chromium-91.0.4472.77/third_party/highway/src/hwy/tests/swizzle_test.cc +--- chromium-91.0.4472.77/third_party/highway/src/hwy/tests/swizzle_test.cc.12 2021-06-02 10:56:05.259904513 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/tests/swizzle_test.cc 2021-05-31 10:37:11.000000000 -0400 +@@ -223,6 +223,7 @@ struct TestTableLookupBytes { + HWY_NOINLINE void TestAllTableLookupBytes() { + ForIntegerTypes(ForPartialVectors()); + } ++ + struct TestTableLookupLanes { + #if HWY_TARGET == HWY_RVV + using Index = uint32_t; +@@ -242,12 +243,13 @@ struct TestTableLookupLanes { + if (N <= 8) { // Test all permutations + for (size_t i0 = 0; i0 < N; ++i0) { + idx[0] = static_cast(i0); ++ + for (size_t i1 = 0; i1 < N; ++i1) { +- idx[1] = static_cast(i1); ++ if (N >= 2) idx[1] = static_cast(i1); + for (size_t i2 = 0; i2 < N; ++i2) { +- idx[2] = static_cast(i2); ++ if (N >= 4) idx[2] = static_cast(i2); + for (size_t i3 = 0; i3 < N; ++i3) { +- idx[3] = static_cast(i3); ++ if (N >= 4) idx[3] = static_cast(i3); + + for (size_t i = 0; i < N; ++i) { + expected[i] = static_cast(idx[i] + 1); // == v[idx[i]] +@@ -286,7 +288,7 @@ struct TestTableLookupLanes { + }; + + HWY_NOINLINE void TestAllTableLookupLanes() { +- const ForFullVectors test; ++ const ForPartialVectors test; + test(uint32_t()); + test(int32_t()); + test(float()); +@@ -624,6 +626,7 @@ HWY_NOINLINE void TestAllOddEven() { + HWY_AFTER_NAMESPACE(); + + #if HWY_ONCE ++namespace hwy { + HWY_BEFORE_TEST(HwySwizzleTest); + HWY_EXPORT_AND_TEST_P(HwySwizzleTest, TestAllShiftBytes); + HWY_EXPORT_AND_TEST_P(HwySwizzleTest, TestAllShiftLanes); +@@ -637,5 +640,5 @@ HWY_EXPORT_AND_TEST_P(HwySwizzleTest, Te + HWY_EXPORT_AND_TEST_P(HwySwizzleTest, TestAllConcatLowerUpper); + HWY_EXPORT_AND_TEST_P(HwySwizzleTest, TestAllConcatUpperLower); + HWY_EXPORT_AND_TEST_P(HwySwizzleTest, TestAllOddEven); +-HWY_AFTER_TEST(); ++} // namespace hwy + #endif +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/tests/swizzle_test.ccE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/tests/swizzle_test.ccE +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/tests/test_util-inl.h.12 chromium-91.0.4472.77/third_party/highway/src/hwy/tests/test_util-inl.h +--- chromium-91.0.4472.77/third_party/highway/src/hwy/tests/test_util-inl.h.12 2021-06-02 10:56:05.254904488 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/hwy/tests/test_util-inl.h 2021-05-31 10:37:11.000000000 -0400 +@@ -23,7 +23,6 @@ + #include + #include + +-#include // isfinite + #include + #include + #include // std::forward +@@ -73,7 +72,8 @@ class TestWithParamTarget : public testi + + // Function to convert the test parameter of a TestWithParamTarget for + // displaying it in the gtest test name. +-std::string TestParamTargetName(const testing::TestParamInfo& info) { ++static inline std::string TestParamTargetName( ++ const testing::TestParamInfo& info) { + return TargetName(info.param); + } + +@@ -157,31 +157,10 @@ std::string TestParamTargetNameAndT( + static_assert(true, "For requiring trailing semicolon") + + #define HWY_BEFORE_TEST(suite) \ +- namespace hwy { \ + class suite : public hwy::TestWithParamTarget {}; \ + HWY_TARGET_INSTANTIATE_TEST_SUITE_P(suite); \ + static_assert(true, "For requiring trailing semicolon") + +-#define HWY_AFTER_TEST() \ +- } /* namespace hwy */ \ +- static_assert(true, "For requiring trailing semicolon") +- +-// Calls test for each enabled and available target. +-template +-HWY_NOINLINE void RunTest(const Func& func, Args&&... args) { +- SetSupportedTargetsForTest(0); +- auto targets = SupportedAndGeneratedTargets(); +- +- for (uint32_t target : targets) { +- SetSupportedTargetsForTest(target); +- fprintf(stderr, "Testing for target %s.\n", +- TargetName(static_cast(target))); +- func(std::forward(args)...); +- } +- // Disable the mask after the test. +- SetSupportedTargetsForTest(0); +-} +- + // 64-bit random generator (Xorshift128+). Much smaller state than std::mt19937, + // which triggers a compiler bug. + class RandomState { +@@ -223,9 +202,11 @@ static HWY_INLINE uint32_t Random32(Rand + // built-in types. + template + inline void PreventElision(T&& output) { +-#ifndef _MSC_VER ++#if HWY_COMPILER_MSVC ++ (void)output; ++#else // HWY_COMPILER_MSVC + asm volatile("" : "+r"(output) : : "memory"); +-#endif ++#endif // HWY_COMPILER_MSVC + } + + // Returns a name for the vector/part/scalar. The type prefix is u/i/f for +@@ -234,23 +215,34 @@ inline void PreventElision(T&& output) { + // understanding which instantiation of a generic test failed. + template + static inline std::string TypeName(T /*unused*/, size_t N) { +- std::string prefix(IsFloat() ? "f" : (IsSigned() ? "i" : "u")); +- prefix += std::to_string(sizeof(T) * 8); +- +- // Scalars: omit the xN suffix. +- if (N == 1) return prefix; +- +- return prefix + 'x' + std::to_string(N); ++ const char prefix = IsFloat() ? 'f' : (IsSigned() ? 'i' : 'u'); ++ char name[64]; ++ // Omit the xN suffix for scalars. ++ if (N == 1) { ++ snprintf(name, sizeof(name), "%c%zu", prefix, sizeof(T) * 8); ++ } else { ++ snprintf(name, sizeof(name), "%c%zux%zu", prefix, sizeof(T) * 8, N); ++ } ++ return name; + } + + // String comparison + + template +-inline bool BytesEqual(const T1* p1, const T2* p2, const size_t size) { ++inline bool BytesEqual(const T1* p1, const T2* p2, const size_t size, ++ size_t* pos = nullptr) { + const uint8_t* bytes1 = reinterpret_cast(p1); + const uint8_t* bytes2 = reinterpret_cast(p2); + for (size_t i = 0; i < size; ++i) { +- if (bytes1[i] != bytes2[i]) return false; ++ if (bytes1[i] != bytes2[i]) { ++ fprintf(stderr, "Mismatch at byte %zu of %zu: %d != %d (%s, %s)\n", i, ++ size, bytes1[i], bytes2[i], TypeName(T1(), 1).c_str(), ++ TypeName(T2(), 1).c_str()); ++ if (pos != nullptr) { ++ *pos = i; ++ } ++ return false; ++ } + } + return true; + } +@@ -287,11 +279,11 @@ HWY_NOINLINE void Print(const D d, const + auto lanes = AllocateAligned(N); + Store(v, d, lanes.get()); + const size_t begin = static_cast(std::max(0, lane - 2)); +- const size_t end = std::min(begin + 5, N); ++ const size_t end = std::min(begin + 7, N); + fprintf(stderr, "%s %s [%zu+ ->]:\n ", TypeName(T(), N).c_str(), caption, + begin); + for (size_t i = begin; i < end; ++i) { +- fprintf(stderr, "%s,", std::to_string(lanes[i]).c_str()); ++ fprintf(stderr, "%g,", double(lanes[i])); + } + if (begin >= end) fprintf(stderr, "(out of bounds)"); + fprintf(stderr, "\n"); +@@ -352,10 +344,12 @@ HWY_NOINLINE void AssertEqual(const T ex + const char* filename = "", const int line = -1, + const size_t lane = 0) { + if (!IsEqual(expected, actual)) { +- const std::string expected_str = std::to_string(expected); +- const std::string actual_str = std::to_string(actual); +- NotifyFailure(filename, line, type_name.c_str(), lane, expected_str.c_str(), +- actual_str.c_str()); ++ char expected_str[100]; ++ snprintf(expected_str, sizeof(expected_str), "%g", double(expected)); ++ char actual_str[100]; ++ snprintf(actual_str, sizeof(actual_str), "%g", double(actual)); ++ NotifyFailure(filename, line, type_name.c_str(), lane, expected_str, ++ actual_str); + } + } + +@@ -382,9 +376,15 @@ HWY_NOINLINE void AssertVecEqual(D d, co + fprintf(stderr, "\n\n"); + Print(d, "expect", expected, i); + Print(d, "actual", actual, i); ++ ++ char expected_str[100]; ++ snprintf(expected_str, sizeof(expected_str), "%g", ++ double(expected_lanes[i])); ++ char actual_str[100]; ++ snprintf(actual_str, sizeof(actual_str), "%g", double(actual_lanes[i])); ++ + NotifyFailure(filename, line, hwy::TypeName(T(), N).c_str(), i, +- std::to_string(expected_lanes[i]).c_str(), +- std::to_string(actual_lanes[i]).c_str()); ++ expected_str, actual_str); + } + } + } +@@ -458,11 +458,8 @@ struct ForeachSizeR ++// Calls Test for all powers of two in [kMinLanes, HWY_LANES(T) / kDivLanes]. ++template + struct ForPartialVectors { + template + void operator()(T /*unused*/) const { +@@ -470,8 +467,8 @@ struct ForPartialVectors { + // Only m1..8 for now, can ignore kMaxLanes because HWY_*_LANES are full. + ForeachSizeR::Do(); + #else +- ForeachSizeR::Do(); ++ ForeachSizeR::Do(); + #endif + } + }; +@@ -505,33 +502,19 @@ struct ForGE128Vectors { + } + }; + +-// Calls Test for all powers of two in [128 bits, max bits/2]. +-template ++// Calls Test for all vectors that can be expanded by kFactor. ++template + struct ForExtendableVectors { + template + void operator()(T /*unused*/) const { + #if HWY_TARGET == HWY_RVV +- ForeachSizeR::Do(); ++ ForeachSizeR::Do(); + #else +- ForeachSizeR::Do(); + #endif + } + }; +- +-// Calls Test for full vectors only. +-template +-struct ForFullVectors { +- template +- void operator()(T t) const { +-#if HWY_TARGET == HWY_RVV +- ForeachSizeR::Do(); +- (void)t; +-#else +- Test()(t, HWY_FULL(T)()); +-#endif +- } +-}; + + // Type lists to shorten call sites: + +diff -up chromium-91.0.4472.77/third_party/highway/src/hwy/tests/test_util-inl.hE.12 chromium-91.0.4472.77/third_party/highway/src/hwy/tests/test_util-inl.hE +diff -up chromium-91.0.4472.77/third_party/highway/src/libhwy.pc.in.12 chromium-91.0.4472.77/third_party/highway/src/libhwy.pc.in +diff -up chromium-91.0.4472.77/third_party/highway/src/libhwy.pc.inE.12 chromium-91.0.4472.77/third_party/highway/src/libhwy.pc.inE +diff -up chromium-91.0.4472.77/third_party/highway/src/libhwy-test.pc.in.12 chromium-91.0.4472.77/third_party/highway/src/libhwy-test.pc.in +diff -up chromium-91.0.4472.77/third_party/highway/src/libhwy-test.pc.inE.12 chromium-91.0.4472.77/third_party/highway/src/libhwy-test.pc.inE +diff -up chromium-91.0.4472.77/third_party/highway/src/LICENSE.12 chromium-91.0.4472.77/third_party/highway/src/LICENSE +diff -up chromium-91.0.4472.77/third_party/highway/src/LICENSEE.12 chromium-91.0.4472.77/third_party/highway/src/LICENSEE +diff -up chromium-91.0.4472.77/third_party/highway/src/Makefile.12 chromium-91.0.4472.77/third_party/highway/src/Makefile +diff -up chromium-91.0.4472.77/third_party/highway/src/MakefileE.12 chromium-91.0.4472.77/third_party/highway/src/MakefileE +diff -up chromium-91.0.4472.77/third_party/highway/src/README.md.12 chromium-91.0.4472.77/third_party/highway/src/README.md +--- chromium-91.0.4472.77/third_party/highway/src/README.md.12 2021-06-02 10:56:05.295904696 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/README.md 2021-05-31 10:37:11.000000000 -0400 +@@ -15,15 +15,19 @@ applying the same operation to 'lanes'. + ## Current status + + Supported targets: scalar, SSE4, AVX2, AVX-512, NEON (ARMv7 and v8), WASM SIMD. +-A port to RVV is in progress. ++Ports to RVV and SVE/SVE2 are in progress. + + Version 0.11 is considered stable enough to use in other projects, and is + expected to remain backwards compatible unless serious issues are discovered + while implementing SVE/RVV targets. After these targets are added, Highway will + reach version 1.0. + +-Continuous integration tests use a recent version of Clang and older version of +-MSVC (VS2015). Also periodically tested on Clang 7-11 and GCC 8, 9 and 10.2.1. ++Continuous integration tests build with a recent version of Clang (running on ++x86 and QEMU for ARM) and MSVC from VS2015 (running on x86). ++ ++Before releases, we also test on x86 with Clang and GCC, and ARMv7/8 via ++GCC cross-compile and QEMU. See the ++[testing process](g3doc/release_testing_process.md) for details. + + The `contrib` directory contains SIMD-related utilities: an image class with + aligned rows, and a math library (16 functions already implemented, mostly +@@ -62,9 +66,11 @@ To test on all the attainable targets fo + default configuration skips baseline targets (e.g. scalar) that are superseded + by another baseline target. + ++Bazel is also supported for building, but it is not as widely used/tested. ++ + ## Quick start + +-You can use the `skeleton` examples inside examples/ as a starting point. ++You can use the `benchmark` inside examples/ as a starting point. + + A [quick-reference page](g3doc/quick_reference.md) briefly lists all operations + and their parameters, and the [instruction_matrix][instmtx] indicates the +diff -up chromium-91.0.4472.77/third_party/highway/src/README.mdE.12 chromium-91.0.4472.77/third_party/highway/src/README.mdE +diff -up chromium-91.0.4472.77/third_party/highway/src/run_tests.bat.12 chromium-91.0.4472.77/third_party/highway/src/run_tests.bat +--- chromium-91.0.4472.77/third_party/highway/src/run_tests.bat.12 2021-06-02 10:56:05.293904685 -0400 ++++ chromium-91.0.4472.77/third_party/highway/src/run_tests.bat 2021-05-31 10:37:11.000000000 -0400 +@@ -2,9 +2,9 @@ + REM Switch directory of this batch file + cd %~dp0 + +-if not exist build mkdir build ++if not exist build_win mkdir build_win + +-cd build ++cd build_win + cmake .. -G Ninja || goto error + ninja || goto error + ctest -j || goto error +diff -up chromium-91.0.4472.77/third_party/highway/src/run_tests.batE.12 chromium-91.0.4472.77/third_party/highway/src/run_tests.batE +diff -up chromium-91.0.4472.77/third_party/highway/src/run_tests.sh.12 chromium-91.0.4472.77/third_party/highway/src/run_tests.sh +diff -up chromium-91.0.4472.77/third_party/highway/src/run_tests.shE.12 chromium-91.0.4472.77/third_party/highway/src/run_tests.shE +diff -up chromium-91.0.4472.77/third_party/llvm/libcxx/test/std/utilities/time/time.hms/time.12 chromium-91.0.4472.77/third_party/llvm/libcxx/test/std/utilities/time/time.hms/time +diff -up chromium-91.0.4472.77/third_party/llvm/llvm/test/tools/gold/X86/v1.12 chromium-91.0.4472.77/third_party/llvm/llvm/test/tools/gold/X86/v1 diff --git a/chromium.spec b/chromium.spec index c606365..4370a44 100644 --- a/chromium.spec +++ b/chromium.spec @@ -7,7 +7,7 @@ # This flag is so I can build things very fast on a giant system. # Do not enable in Koji builds. -%global use_all_cpus 0 +%global use_all_cpus 1 %if %{use_all_cpus} %global numjobs %{_smp_build_ncpus} @@ -208,14 +208,14 @@ BuildRequires: libicu-devel >= 5.4 %global chromoting_client_id %nil %endif -%global majorversion 90 +%global majorversion 91 %if %{freeworld} Name: chromium%{chromium_channel}%{nsuffix} %else Name: chromium%{chromium_channel} %endif -Version: %{majorversion}.0.4430.212 +Version: %{majorversion}.0.4472.77 Release: 1%{?dist} %if %{?freeworld} %if %{?shared} @@ -234,7 +234,7 @@ License: BSD and LGPLv2+ and ASL 2.0 and IJG and MIT and GPLv2+ and ISC and Open ### Chromium Fedora Patches ### Patch0: chromium-70.0.3538.67-sandbox-pie.patch # Use /etc/chromium for initial_prefs -Patch1: chromium-89.0.4389.72-initial_prefs-etc-path.patch +Patch1: chromium-91.0.4472.77-initial_prefs-etc-path.patch # Use gn system files Patch2: chromium-67.0.3396.62-gn-system.patch # Do not prefix libpng functions @@ -249,7 +249,7 @@ Patch6: chromium-89.0.4389.72-norar.patch # https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/files/chromium-widevine-r3.patch Patch7: chromium-71.0.3578.98-widevine-r3.patch # Disable fontconfig cache magic that breaks remoting -Patch8: chromium-83.0.4103.61-disable-fontconfig-cache-magic.patch +Patch8: chromium-91.0.4472.77-disable-fontconfig-cache-magic.patch # drop rsp clobber, which breaks gcc9 (thanks to Jeff Law) Patch9: chromium-78.0.3904.70-gcc9-drop-rsp-clobber.patch # Try to load widevine from other places @@ -274,16 +274,20 @@ Patch57: chromium-89.0.4389.72-missing-cstring-header.patch # prepare for using system ffmpeg (clean) # http://svnweb.mageia.org/packages/cauldron/chromium-browser-stable/current/SOURCES/chromium-53-ffmpeg-no-deprecation-errors.patch?view=markup Patch58: chromium-53-ffmpeg-no-deprecation-errors.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-90-angle-constexpr.patch -Patch59: chromium-90-angle-constexpr.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-90-CrossThreadCopier-qualification.patch -Patch60: chromium-90-CrossThreadCopier-qualification.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-90-quantization_utils-include.patch -Patch61: chromium-90-quantization_utils-include.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-91-pcscan-vector-types.patch +Patch59: chromium-91-pcscan-vector-types.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-91-libyuv-aarch64.patch +Patch60: chromium-91-libyuv-aarch64.patch +# Update third_party/highway to 0.12.2 +# this is needed for sane arm/aarch64 +Patch61: chromium-91.0.4472.77-update-highway-0.12.2.patch # https://github.com/stha09/chromium-patches/blob/master/chromium-90-ruy-include.patch Patch62: chromium-90-ruy-include.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-90-TokenizedOutput-include.patch -Patch63: chromium-90-TokenizedOutput-include.patch +# Extra CXXFLAGS for aarch64 +Patch63: chromium-91.0.4472.77-aarch64-cxxflags-addition.patch +# Fix issue where closure_compiler thinks java is only allowed in android builds +# https://bugs.chromium.org/p/chromium/issues/detail?id=1192875 +Patch64: chromium-91.0.4472.77-java-only-allowed-in-android-builds.patch # Silence GCC warnings during gn compile Patch65: chromium-84.0.4147.105-gn-gcc-cleanup.patch @@ -300,9 +304,6 @@ Patch75: chromium-90.0.4430.72-fstatfix.patch Patch76: chromium-88.0.4324.182-rawhide-gcc-std-max-fix.patch # Fix symbol visibility with gcc on swiftshader's libEGL Patch77: chromium-88.0.4324.182-gcc-fix-swiftshader-libEGL-visibility.patch -# Include support for futex_time64 (64bit time on 32bit platforms) -# https://chromium.googlesource.com/chromium/src/+/955a586c63c4f99fb734e44221db63f5b2ca25a9%5E%21/#F0 -Patch78: chromium-89.0.4389.82-support-futex_time64.patch # Do not download proprietary widevine module in the background (thanks Debian) Patch79: chromium-90.0.4430.72-widevine-no-download.patch # Fix crashes with components/cast_* @@ -409,6 +410,7 @@ BuildRequires: harfbuzz-devel >= 2.4.0 %endif BuildRequires: libatomic BuildRequires: libcap-devel +BuildRequires: libcurl-devel %if 0%{?bundlelibdrm} #nothing %else @@ -924,12 +926,12 @@ udev. %patch56 -p1 -b .missing-cstdint %patch57 -p1 -b .missing-cstring %patch58 -p1 -b .ffmpeg-deprecations -%patch59 -p1 -b .angle-constexpr -%patch60 -p1 -b .CrossThreadCopier-qualification -%patch61 -p1 -b .quantization_utils-include +%patch59 -p1 -b .pcscan-vector-types +%patch60 -p1 -b .libyuv-aarch64 +%patch61 -p1 -b .update-highway-0.12.2 %patch62 -p1 -b .ruy-include -%patch63 -p1 -b .TokenizedOutput - +%patch63 -p1 -b .aarch64-cxxflags-addition +%patch64 -p1 -b .java-only-allowed %patch65 -p1 -b .gn-gcc-cleanup %patch66 -p1 -b .remoting-cstring %patch67 -p1 -b .i686-textrels @@ -939,7 +941,6 @@ udev. %patch76 -p1 -b .sigstkszfix %endif %patch77 -p1 -b .gcc-swiftshader-visibility -%patch78 -p1 -b .futex-time64 %patch79 -p1 -b .widevine-no-download %patch80 -p1 -b .EnumTable-crash @@ -1209,6 +1210,7 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/cros_system_api' \ 'third_party/dav1d' \ 'third_party/dawn' \ + 'third_party/dawn/third_party/khronos' \ 'third_party/depot_tools' \ 'third_party/devscripts' \ 'third_party/devtools-frontend' \ @@ -1247,6 +1249,7 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/googletest' \ 'third_party/grpc' \ 'third_party/harfbuzz-ng' \ + 'third_party/highway' \ 'third_party/hunspell' \ 'third_party/iccjpeg' \ 'third_party/icu' \ @@ -1268,6 +1271,7 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/libgifcodec' \ 'third_party/libjingle' \ 'third_party/libjpeg_turbo' \ + 'third_party/libjxl' \ 'third_party/libphonenumber' \ 'third_party/libpng' \ 'third_party/libsecret' \ @@ -1341,7 +1345,6 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/rnnoise' \ 'third_party/ruy' \ 'third_party/s2cellid' \ - 'third_party/schema_org' \ 'third_party/securemessage' \ 'third_party/shell-encryption' \ 'third_party/simplejson' \ @@ -1378,6 +1381,7 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/wayland' \ 'third_party/web-animations-js' \ 'third_party/webdriver' \ + 'third_party/webgpu-cts' \ 'third_party/webrtc' \ 'third_party/webrtc/common_audio/third_party/ooura' \ 'third_party/webrtc/common_audio/third_party/spl_sqrt_floor' \ @@ -1943,6 +1947,10 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %lang(vi) %{chromium_path}/locales/vi.pak* %lang(zh_CN) %{chromium_path}/locales/zh-CN.pak* %lang(zh_TW) %{chromium_path}/locales/zh-TW.pak* +# These are psuedolocales, not real ones. +# So we just include them always. +%{chromium_path}/locales/ar-XB.pak* +%{chromium_path}/locales/en-XA.pak* %if %{build_headless} %files headless @@ -1999,6 +2007,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Tue Jun 1 2021 Tom Callaway - 91.0.4472.77-1 +- update to 91.0.4472.77 + * Tue May 18 2021 Tom Callaway - 90.0.4430.212-1 - update to 90.0.4430.212 diff --git a/clean_ffmpeg.sh b/clean_ffmpeg.sh index cf9c5f2..ac34ca2 100755 --- a/clean_ffmpeg.sh +++ b/clean_ffmpeg.sh @@ -127,6 +127,7 @@ header_files=" libavcodec/x86/inline_asm.h \ libavcodec/pixblockdsp.h \ libavcodec/pixels.h \ libavcodec/png.h \ + libavcodec/pngdsp.h \ libavcodec/put_bits.h \ libavcodec/qpeldsp.h \ libavcodec/ratecontrol.h \ @@ -297,7 +298,6 @@ mp3_files=" libavcodec/aarch64/aacpsdsp_init_aarch64.c \ libavcodec/sbrdsp.c \ libavcodec/sbrdsp_template.c \ libavcodec/sinewin.c \ - libavcodec/sinewin_fixed.c \ libavcodec/x86/dct_init.c \ libavcodec/x86/dct32.asm \ libavcodec/x86/imdct36.asm \ diff --git a/sources b/sources index 5fdb3e3..727f450 100644 --- a/sources +++ b/sources @@ -20,4 +20,4 @@ SHA512 (xcb-proto-1.14.tar.xz) = de66d568163b6da2be9d6c59984f3afa3acd119a7813786 SHA512 (depot_tools.git-master.tar.gz) = dc323888812b66cc92c53a24a8a58ccf9e2961be67aa21852bd091b8b49569071f06ae9104cb58950e6253ac3a29f0db0663e9f35ef2b1ea28696efb38b42708 SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1dc09f5a0fd7898e9d0a372ee4422b6b1cdab3c86ecc91db437e9ae8a951e64e85edc3ac9e9fca428852dbb2ad SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a -SHA512 (chromium-90.0.4430.212-clean.tar.xz) = 53c16fcb899ae5de73599a67c7652801b4779c9642c2dacc2f211e6c6accd455507594138e59dcbabe9f80493d78fd4d0d118a58284d9d62f149e549dbba8ccc +SHA512 (chromium-91.0.4472.77-clean.tar.xz) = 52e4daec5cbaaa91851d33c0699bb0529c2b84bf2d95937cd043914eaf7c75c9e2d512904038acd367888bc465dfe6e4217f2eb1670f2f9ee3cae1f2c2a57d0a From f3cd23dcd8ec022b58cc563751c5ea40cf2ea8af Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Wed, 2 Jun 2021 16:36:33 -0400 Subject: [PATCH 003/659] fix conditional in flax-vector-conversions patch --- chromium-91.0.4472.77-aarch64-cxxflags-addition.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chromium-91.0.4472.77-aarch64-cxxflags-addition.patch b/chromium-91.0.4472.77-aarch64-cxxflags-addition.patch index 249adf4..0e2e5cd 100644 --- a/chromium-91.0.4472.77-aarch64-cxxflags-addition.patch +++ b/chromium-91.0.4472.77-aarch64-cxxflags-addition.patch @@ -5,7 +5,7 @@ diff -up chromium-91.0.4472.77/build/config/compiler/BUILD.gn.aarch-cxxflags chr cflags += [ "-Wno-psabi" ] } -+ if (current_cpu == "arm" && !is_clang) { ++ if (current_cpu == "arm64" && !is_clang) { + cflags_cc += [ "-flax-vector-conversions" ] + } + From ed9abbb8e7b3b0656fa27c411ac0e1bdddfe9e5a Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Thu, 3 Jun 2021 10:44:20 -0400 Subject: [PATCH 004/659] disable use all cpus --- chromium.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chromium.spec b/chromium.spec index 4370a44..e4b9fc7 100644 --- a/chromium.spec +++ b/chromium.spec @@ -7,7 +7,7 @@ # This flag is so I can build things very fast on a giant system. # Do not enable in Koji builds. -%global use_all_cpus 1 +%global use_all_cpus 0 %if %{use_all_cpus} %global numjobs %{_smp_build_ncpus} From baaf27b384295d6288ef367dd108ce9874543f2d Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Wed, 23 Jun 2021 10:59:32 -0400 Subject: [PATCH 005/659] 91.0.4472.114 --- chromium.spec | 5 ++++- sources | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/chromium.spec b/chromium.spec index e4b9fc7..4d81888 100644 --- a/chromium.spec +++ b/chromium.spec @@ -215,7 +215,7 @@ Name: chromium%{chromium_channel}%{nsuffix} %else Name: chromium%{chromium_channel} %endif -Version: %{majorversion}.0.4472.77 +Version: %{majorversion}.0.4472.114 Release: 1%{?dist} %if %{?freeworld} %if %{?shared} @@ -2007,6 +2007,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Wed Jun 23 2021 Tom Callaway - 91.0.4472.114-1 +- update to 91.0.4472.114 + * Tue Jun 1 2021 Tom Callaway - 91.0.4472.77-1 - update to 91.0.4472.77 diff --git a/sources b/sources index 727f450..5bade36 100644 --- a/sources +++ b/sources @@ -20,4 +20,4 @@ SHA512 (xcb-proto-1.14.tar.xz) = de66d568163b6da2be9d6c59984f3afa3acd119a7813786 SHA512 (depot_tools.git-master.tar.gz) = dc323888812b66cc92c53a24a8a58ccf9e2961be67aa21852bd091b8b49569071f06ae9104cb58950e6253ac3a29f0db0663e9f35ef2b1ea28696efb38b42708 SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1dc09f5a0fd7898e9d0a372ee4422b6b1cdab3c86ecc91db437e9ae8a951e64e85edc3ac9e9fca428852dbb2ad SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a -SHA512 (chromium-91.0.4472.77-clean.tar.xz) = 52e4daec5cbaaa91851d33c0699bb0529c2b84bf2d95937cd043914eaf7c75c9e2d512904038acd367888bc465dfe6e4217f2eb1670f2f9ee3cae1f2c2a57d0a +SHA512 (chromium-91.0.4472.114-clean.tar.xz) = 2379fdbca889cfed28e9ab530eabcd654f16ee2d4313d684fd8eafdb9b4c25efa04e0af23323537c7a492e7913125c59ec8b53c2b7437e20496882c9af47a9be From f118837e7ffeb6f6b524a86a6b1e618997dc00eb Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Mon, 28 Jun 2021 11:10:48 -0400 Subject: [PATCH 006/659] adjust epel7 old headers patch --- chromium-90.0.4430.93-epel7-old-headers-workarounds.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chromium-90.0.4430.93-epel7-old-headers-workarounds.patch b/chromium-90.0.4430.93-epel7-old-headers-workarounds.patch index d725164..e4f541d 100644 --- a/chromium-90.0.4430.93-epel7-old-headers-workarounds.patch +++ b/chromium-90.0.4430.93-epel7-old-headers-workarounds.patch @@ -1,9 +1,9 @@ diff -up chromium-90.0.4430.85/mojo/core/channel_linux.cc.epel7-kcmp chromium-90.0.4430.85/mojo/core/channel_linux.cc --- chromium-90.0.4430.85/mojo/core/channel_linux.cc.epel7-kcmp 2021-04-27 11:42:46.207245608 -0400 +++ chromium-90.0.4430.85/mojo/core/channel_linux.cc 2021-04-27 11:43:21.941841419 -0400 -@@ -37,6 +37,25 @@ - #include "mojo/core/core.h" - #include "mojo/core/embedder/features.h" +@@ -43,6 +43,25 @@ + #define EFD_ZERO_ON_WAKE O_NOFOLLOW + #endif +#ifndef F_LINUX_SPECIFIC_BASE +#define F_LINUX_SPECIFIC_BASE 1024 From b40f3db72f2aa68029fe5011c9a55254fd0b0b7a Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Mon, 28 Jun 2021 13:48:34 -0400 Subject: [PATCH 007/659] update epel7-erase-fix patch --- chromium-91.0.4472.114-epel7-erase-fix.patch | 20 ++++++++++++++++++++ chromium.spec | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 chromium-91.0.4472.114-epel7-erase-fix.patch diff --git a/chromium-91.0.4472.114-epel7-erase-fix.patch b/chromium-91.0.4472.114-epel7-erase-fix.patch new file mode 100644 index 0000000..42dcf3d --- /dev/null +++ b/chromium-91.0.4472.114-epel7-erase-fix.patch @@ -0,0 +1,20 @@ +diff -up chromium-91.0.4472.114/components/ui_devtools/views/view_element.cc.erase-fix chromium-91.0.4472.114/components/ui_devtools/views/view_element.cc +--- chromium-91.0.4472.114/components/ui_devtools/views/view_element.cc.erase-fix 2021-06-28 13:47:06.751802159 -0400 ++++ chromium-91.0.4472.114/components/ui_devtools/views/view_element.cc 2021-06-28 13:47:20.097876929 -0400 +@@ -24,14 +24,14 @@ namespace { + // Remove any custom editor "prefixes" from the property name. The prefixes must + // not be valid identifier characters. + void StripPrefix(std::string& property_name) { +- auto cur = property_name.cbegin(); ++ auto cur = property_name.begin(); + for (; cur < property_name.cend(); ++cur) { + if ((*cur >= 'A' && *cur <= 'Z') || (*cur >= 'a' && *cur <= 'z') || + *cur == '_') { + break; + } + } +- property_name.erase(property_name.cbegin(), cur); ++ property_name.erase(property_name.begin(), cur); + } + + ui::EventType GetMouseEventType(const std::string& type) { diff --git a/chromium.spec b/chromium.spec index 4d81888..8737fd0 100644 --- a/chromium.spec +++ b/chromium.spec @@ -332,7 +332,7 @@ Patch108: chromium-85.0.4183.83-el7-old-libdrm.patch # error: no matching function for call to 'std::basic_string::erase(std::basic_string::const_iterator, __gnu_cxx::__normal_iterator >&)' # 33 | property_name.erase(property_name.cbegin(), cur); # Not sure how this EVER worked anywhere, but it only seems to fail on EPEL-7. -Patch109: chromium-90.0.4430.93-epel7-erase-fix.patch +Patch109: chromium-91.0.4472.114-epel7-erase-fix.patch # Again, not sure how epel8 is the only one to hit this... # AARCH64 neon symbols need to be prefixed too to prevent multiple definition issue at linktime Patch110: chromium-90.0.4430.93-epel8-aarch64-libpng16-symbol-prefixes.patch From ec9d3bbd9e32e4f9d16ccd39eb7f52a9ae0a8ef6 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Mon, 28 Jun 2021 14:42:53 -0400 Subject: [PATCH 008/659] try with dts_version 10? --- chromium.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chromium.spec b/chromium.spec index 8737fd0..5a8ca41 100644 --- a/chromium.spec +++ b/chromium.spec @@ -144,7 +144,7 @@ BuildRequires: libicu-devel >= 5.4 %global gtk3 1 %if 0%{?rhel} == 7 || 0%{?rhel} == 8 -%global dts_version 9 +%global dts_version 10 %global bundleopus 1 %global bundlelibusbx 1 From a7ab43e15f596aabec2e5df53c9b206060b17db9 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Tue, 6 Jul 2021 10:26:38 -0400 Subject: [PATCH 009/659] fix ThemeService crash (thanks OpenSUSE) --- chromium-91-1190561-boo1186948.patch | 45 ++++++++++++++++++++++++++++ chromium.spec | 8 ++++- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 chromium-91-1190561-boo1186948.patch diff --git a/chromium-91-1190561-boo1186948.patch b/chromium-91-1190561-boo1186948.patch new file mode 100644 index 0000000..b9fd1f7 --- /dev/null +++ b/chromium-91-1190561-boo1186948.patch @@ -0,0 +1,45 @@ +From c2d0133f47afb59b4ce64e42215d1d053f15250a Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Tue, 13 Apr 2021 23:21:42 +0000 +Subject: [PATCH] fix crash in ThemeService + +ThemeSyncableService and ThemeService are owned by each other. On +destruction of ThemeService, ThemeSyncableService gets destructed as +well, but calls RemoveObserver of partly destructed ThemeService object. +To avoid already destructed |observers_| list, move it before +|theme_syncable_service_| definition. + +Bug: 1190561 +Change-Id: I4dc2c990d589071d97b7fa737afef54463c84751 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2821311 +Commit-Queue: Peter Kasting +Reviewed-by: Peter Kasting +Cr-Commit-Position: refs/heads/master@{#872164} +--- + chrome/browser/themes/theme_service.h | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/chrome/browser/themes/theme_service.h b/chrome/browser/themes/theme_service.h +index 592d40ae9de0f..337dfac9a040f 100644 +--- a/chrome/browser/themes/theme_service.h ++++ b/chrome/browser/themes/theme_service.h +@@ -299,6 +299,10 @@ class ThemeService : public KeyedService, + // The number of infobars currently displayed. + int number_of_reinstallers_ = 0; + ++ // Declared before |theme_syncable_service_|, because ThemeSyncableService ++ // removes itself from the |observers_| list on destruction. ++ base::ObserverList observers_; ++ + std::unique_ptr theme_syncable_service_; + + #if BUILDFLAG(ENABLE_EXTENSIONS) +@@ -320,8 +324,6 @@ class ThemeService : public KeyedService, + ScopedObserver + native_theme_observer_{this}; + +- base::ObserverList observers_; +- + base::WeakPtrFactory weak_ptr_factory_{this}; + + DISALLOW_COPY_AND_ASSIGN(ThemeService); diff --git a/chromium.spec b/chromium.spec index 4d81888..4b6a0fb 100644 --- a/chromium.spec +++ b/chromium.spec @@ -216,7 +216,7 @@ Name: chromium%{chromium_channel}%{nsuffix} Name: chromium%{chromium_channel} %endif Version: %{majorversion}.0.4472.114 -Release: 1%{?dist} +Release: 2%{?dist} %if %{?freeworld} %if %{?shared} # chromium-libs-media-freeworld @@ -309,6 +309,8 @@ Patch79: chromium-90.0.4430.72-widevine-no-download.patch # Fix crashes with components/cast_* # Thanks to Gentoo Patch80: https://gitweb.gentoo.org/repo/gentoo.git/plain/www-client/chromium/files/chromium-89-EnumTable-crash.patch +# Fix crashes with ThemeService, thanks OpenSUSE +Patch81: chromium-91-1190561-boo1186948.patch # Use lstdc++ on EPEL7 only @@ -943,6 +945,7 @@ udev. %patch77 -p1 -b .gcc-swiftshader-visibility %patch79 -p1 -b .widevine-no-download %patch80 -p1 -b .EnumTable-crash +%patch81 -p1 -b .ThemeService-crash # Fedora branded user agent %if 0%{?fedora} @@ -2007,6 +2010,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Tue Jul 6 2021 Tom Callaway - 91.0.4472.114-2 +- fix ThemeService crash (thanks OpenSUSE) + * Wed Jun 23 2021 Tom Callaway - 91.0.4472.114-1 - update to 91.0.4472.114 From 2a62af5a0b7833b52474b94f5bdc2953e6429558 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Fri, 16 Jul 2021 15:08:53 -0400 Subject: [PATCH 010/659] 91.0.4472.164 --- chromium.spec | 7 +++++-- sources | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/chromium.spec b/chromium.spec index 4b6a0fb..e4af9ba 100644 --- a/chromium.spec +++ b/chromium.spec @@ -215,8 +215,8 @@ Name: chromium%{chromium_channel}%{nsuffix} %else Name: chromium%{chromium_channel} %endif -Version: %{majorversion}.0.4472.114 -Release: 2%{?dist} +Version: %{majorversion}.0.4472.164 +Release: 1%{?dist} %if %{?freeworld} %if %{?shared} # chromium-libs-media-freeworld @@ -2010,6 +2010,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Fri Jul 16 2021 Tom Callaway - 91.0.4472.164-1 +- update to 91.0.4472.164 + * Tue Jul 6 2021 Tom Callaway - 91.0.4472.114-2 - fix ThemeService crash (thanks OpenSUSE) diff --git a/sources b/sources index 5bade36..2e8e02b 100644 --- a/sources +++ b/sources @@ -20,4 +20,4 @@ SHA512 (xcb-proto-1.14.tar.xz) = de66d568163b6da2be9d6c59984f3afa3acd119a7813786 SHA512 (depot_tools.git-master.tar.gz) = dc323888812b66cc92c53a24a8a58ccf9e2961be67aa21852bd091b8b49569071f06ae9104cb58950e6253ac3a29f0db0663e9f35ef2b1ea28696efb38b42708 SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1dc09f5a0fd7898e9d0a372ee4422b6b1cdab3c86ecc91db437e9ae8a951e64e85edc3ac9e9fca428852dbb2ad SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a -SHA512 (chromium-91.0.4472.114-clean.tar.xz) = 2379fdbca889cfed28e9ab530eabcd654f16ee2d4313d684fd8eafdb9b4c25efa04e0af23323537c7a492e7913125c59ec8b53c2b7437e20496882c9af47a9be +SHA512 (chromium-91.0.4472.164-clean.tar.xz) = 71e3449e2042d83df50a7ea753e5b09bfc331640665f0d9b8d99a424b32a316a92c7bb2726ce51c5418936f423f2f7167fcfc57d51ca658e7e32347e8452efbc From 889105be3180275f1bb9984473ebd37eb8daf529 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 21 Jul 2021 14:29:15 +0000 Subject: [PATCH 011/659] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering From e3df3fa73e6d2a3b46dcd0ffd61e701060621714 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 21 Jul 2021 19:26:26 +0000 Subject: [PATCH 012/659] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- chromium.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chromium.spec b/chromium.spec index e4af9ba..30e7be0 100644 --- a/chromium.spec +++ b/chromium.spec @@ -216,7 +216,7 @@ Name: chromium%{chromium_channel}%{nsuffix} Name: chromium%{chromium_channel} %endif Version: %{majorversion}.0.4472.164 -Release: 1%{?dist} +Release: 2%{?dist} %if %{?freeworld} %if %{?shared} # chromium-libs-media-freeworld @@ -2010,6 +2010,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Wed Jul 21 2021 Fedora Release Engineering - 91.0.4472.164-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Fri Jul 16 2021 Tom Callaway - 91.0.4472.164-1 - update to 91.0.4472.164 From c3fea076996d62bff1404d06de5ef3adf93426db Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Mon, 26 Jul 2021 22:30:10 -0400 Subject: [PATCH 013/659] 92.0.4515.107 --- chromium-92-v8-constexpr.patch | 17 + chromium-92.0.4515.107-EnumTable-crash.patch | 70 + chromium-92.0.4515.107-gn-gcc-cleanup.patch | 45 + chromium-92.0.4515.107-norar.patch | 90 + chromium-92.0.4515.107-py2-bootstrap.patch | 24 + ...2.0.4515.107-rawhide-gcc-std-max-fix.patch | 13 + ...-92.0.4515.107-update-highway-0.12.2.patch | 4199 +++++++++++++++++ ....0.4515.107-widevine-other-locations.patch | 20 + chromium.spec | 36 +- sources | 2 +- 10 files changed, 4496 insertions(+), 20 deletions(-) create mode 100644 chromium-92-v8-constexpr.patch create mode 100644 chromium-92.0.4515.107-EnumTable-crash.patch create mode 100644 chromium-92.0.4515.107-gn-gcc-cleanup.patch create mode 100644 chromium-92.0.4515.107-norar.patch create mode 100644 chromium-92.0.4515.107-py2-bootstrap.patch create mode 100644 chromium-92.0.4515.107-rawhide-gcc-std-max-fix.patch create mode 100644 chromium-92.0.4515.107-update-highway-0.12.2.patch create mode 100644 chromium-92.0.4515.107-widevine-other-locations.patch diff --git a/chromium-92-v8-constexpr.patch b/chromium-92-v8-constexpr.patch new file mode 100644 index 0000000..cbe1347 --- /dev/null +++ b/chromium-92-v8-constexpr.patch @@ -0,0 +1,17 @@ +GCC: make VRegister::from_code() constexpr on aarch64 + +LiftoffRegister::gp() and LiftoffRegister::fp() are constexpr. +Therefore, VRegister::from_code() needs to be constexpr as well. +diff --git a/v8/src/codegen/arm64/register-arm64.h b/v8/src/codegen/arm64/register-arm64.h +index 1150daf..21007a5 100644 +--- a/v8/src/codegen/arm64/register-arm64.h ++++ b/v8/src/codegen/arm64/register-arm64.h +@@ -413,7 +413,7 @@ class VRegister : public CPURegister { + static constexpr int kMaxNumRegisters = kNumberOfVRegisters; + STATIC_ASSERT(kMaxNumRegisters == kDoubleAfterLast); + +- static VRegister from_code(int code) { ++ static constexpr VRegister from_code(int code) { + // Always return a D register. + return VRegister::Create(code, kDRegSizeInBits); + } diff --git a/chromium-92.0.4515.107-EnumTable-crash.patch b/chromium-92.0.4515.107-EnumTable-crash.patch new file mode 100644 index 0000000..e9eaab6 --- /dev/null +++ b/chromium-92.0.4515.107-EnumTable-crash.patch @@ -0,0 +1,70 @@ +diff -up chromium-92.0.4515.107/components/cast_channel/enum_table.h.EnumTable-crash chromium-92.0.4515.107/components/cast_channel/enum_table.h +--- chromium-92.0.4515.107/components/cast_channel/enum_table.h.EnumTable-crash 2021-07-19 14:45:12.000000000 -0400 ++++ chromium-92.0.4515.107/components/cast_channel/enum_table.h 2021-07-26 17:41:21.987375385 -0400 +@@ -212,7 +212,7 @@ class + + template + friend class EnumTable; +- DISALLOW_COPY_AND_ASSIGN(GenericEnumTableEntry); ++ DISALLOW_ASSIGN(GenericEnumTableEntry); + }; + + // Yes, these constructors really needs to be inlined. Even though they look +@@ -250,8 +250,7 @@ class EnumTable { + // Constructor for regular entries. + constexpr Entry(E value, base::StringPiece str) + : GenericEnumTableEntry(static_cast(value), str) {} +- +- DISALLOW_COPY_AND_ASSIGN(Entry); ++ DISALLOW_ASSIGN(Entry); + }; + + static_assert(sizeof(E) <= sizeof(int32_t), +@@ -306,15 +305,14 @@ class EnumTable { + if (is_sorted_) { + const std::size_t index = static_cast(value); + if (ANALYZER_ASSUME_TRUE(index < data_.size())) { +- const auto& entry = data_.begin()[index]; ++ const auto& entry = data_[index]; + if (ANALYZER_ASSUME_TRUE(entry.has_str())) + return entry.str(); + } + return absl::nullopt; + } + return GenericEnumTableEntry::FindByValue( +- reinterpret_cast(data_.begin()), +- data_.size(), static_cast(value)); ++ &data_[0], data_.size(), static_cast(value)); + } + + // This overload of GetString is designed for cases where the argument is a +@@ -342,8 +340,7 @@ class EnumTable { + // enum value directly. + absl::optional GetEnum(base::StringPiece str) const { + auto* entry = GenericEnumTableEntry::FindByString( +- reinterpret_cast(data_.begin()), +- data_.size(), str); ++ &data_[0], data_.size(), str); + return entry ? static_cast(entry->value) : absl::optional(); + } + +@@ -358,7 +355,7 @@ class EnumTable { + // Align the data on a cache line boundary. + alignas(64) + #endif +- std::initializer_list data_; ++ const std::vector data_; + bool is_sorted_; + + constexpr EnumTable(std::initializer_list data, bool is_sorted) +@@ -370,8 +367,8 @@ class EnumTable { + + for (std::size_t i = 0; i < data.size(); i++) { + for (std::size_t j = i + 1; j < data.size(); j++) { +- const Entry& ei = data.begin()[i]; +- const Entry& ej = data.begin()[j]; ++ const Entry& ei = data[i]; ++ const Entry& ej = data[j]; + DCHECK(ei.value != ej.value) + << "Found duplicate enum values at indices " << i << " and " << j; + DCHECK(!(ei.has_str() && ej.has_str() && ei.str() == ej.str())) diff --git a/chromium-92.0.4515.107-gn-gcc-cleanup.patch b/chromium-92.0.4515.107-gn-gcc-cleanup.patch new file mode 100644 index 0000000..c61b51b --- /dev/null +++ b/chromium-92.0.4515.107-gn-gcc-cleanup.patch @@ -0,0 +1,45 @@ +diff -up chromium-92.0.4515.107/tools/gn/src/gn/err.h.gn-gcc-cleanup chromium-92.0.4515.107/tools/gn/src/gn/err.h +--- chromium-92.0.4515.107/tools/gn/src/gn/err.h.gn-gcc-cleanup 2021-07-19 14:54:04.000000000 -0400 ++++ chromium-92.0.4515.107/tools/gn/src/gn/err.h 2021-07-26 17:23:54.477420431 -0400 +@@ -56,7 +56,7 @@ class Err { + const std::string& help_text = std::string()); + + Err(const Err& other); +- ++ Err& operator=(const Err& other) = default; + ~Err(); + + bool has_error() const { return has_error_; } +diff -up chromium-92.0.4515.107/tools/gn/src/gn/label_pattern.h.gn-gcc-cleanup chromium-92.0.4515.107/tools/gn/src/gn/label_pattern.h +--- chromium-92.0.4515.107/tools/gn/src/gn/label_pattern.h.gn-gcc-cleanup 2021-07-26 17:23:54.478420447 -0400 ++++ chromium-92.0.4515.107/tools/gn/src/gn/label_pattern.h 2021-07-26 17:26:36.904894419 -0400 +@@ -33,6 +33,7 @@ class LabelPattern { + std::string_view name, + const Label& toolchain_label); + LabelPattern(const LabelPattern& other); ++ LabelPattern& operator=(const LabelPattern& other) = default; + ~LabelPattern(); + + // Converts the given input string to a pattern. This does special stuff +diff -up chromium-92.0.4515.107/tools/gn/src/gn/substitution_list.h.gn-gcc-cleanup chromium-92.0.4515.107/tools/gn/src/gn/substitution_list.h +--- chromium-92.0.4515.107/tools/gn/src/gn/substitution_list.h.gn-gcc-cleanup 2021-07-19 14:54:04.000000000 -0400 ++++ chromium-92.0.4515.107/tools/gn/src/gn/substitution_list.h 2021-07-26 17:23:54.478420447 -0400 +@@ -15,6 +15,7 @@ class SubstitutionList { + public: + SubstitutionList(); + SubstitutionList(const SubstitutionList& other); ++ SubstitutionList& operator=(const SubstitutionList& other) = default; + ~SubstitutionList(); + + bool Parse(const Value& value, Err* err); +diff -up chromium-92.0.4515.107/tools/gn/src/gn/substitution_pattern.h.gn-gcc-cleanup chromium-92.0.4515.107/tools/gn/src/gn/substitution_pattern.h +--- chromium-92.0.4515.107/tools/gn/src/gn/substitution_pattern.h.gn-gcc-cleanup 2021-07-19 14:54:04.000000000 -0400 ++++ chromium-92.0.4515.107/tools/gn/src/gn/substitution_pattern.h 2021-07-26 17:23:54.478420447 -0400 +@@ -35,6 +35,7 @@ class SubstitutionPattern { + + SubstitutionPattern(); + SubstitutionPattern(const SubstitutionPattern& other); ++ SubstitutionPattern& operator=(const SubstitutionPattern& other) = default; + ~SubstitutionPattern(); + + // Parses the given string and fills in the pattern. The pattern must only diff --git a/chromium-92.0.4515.107-norar.patch b/chromium-92.0.4515.107-norar.patch new file mode 100644 index 0000000..311caf6 --- /dev/null +++ b/chromium-92.0.4515.107-norar.patch @@ -0,0 +1,90 @@ +diff -up chromium-92.0.4515.107/chrome/common/safe_browsing/BUILD.gn.nounrar chromium-92.0.4515.107/chrome/common/safe_browsing/BUILD.gn +--- chromium-92.0.4515.107/chrome/common/safe_browsing/BUILD.gn.nounrar 2021-07-19 14:45:10.000000000 -0400 ++++ chromium-92.0.4515.107/chrome/common/safe_browsing/BUILD.gn 2021-07-26 16:44:53.670761825 -0400 +@@ -43,39 +43,6 @@ if (safe_browsing_mode == 1) { + public_deps = [ "//components/safe_browsing/core:csd_proto" ] + } + +- source_set("rar_analyzer") { +- sources = [ +- "rar_analyzer.cc", +- "rar_analyzer.h", +- ] +- +- deps = [ +- ":archive_analyzer_results", +- ":download_type_util", +- "//base", +- "//base:i18n", +- "//components/safe_browsing/core:features", +- "//components/safe_browsing/core:file_type_policies", +- "//third_party/unrar:unrar", +- ] +- +- defines = [ +- "_FILE_OFFSET_BITS=64", +- "LARGEFILE_SOURCE", +- "RAR_SMP", +- "SILENT", +- +- # The following is set to disable certain macro definitions in the unrar +- # source code. +- "CHROMIUM_UNRAR", +- +- # Disables exceptions in unrar, replaces them with process termination. +- "UNRAR_NO_EXCEPTIONS", +- ] +- +- public_deps = [ "//components/safe_browsing/core:csd_proto" ] +- } +- + if (is_mac) { + source_set("disk_image_type_sniffer_mac") { + sources = [ +@@ -145,7 +112,6 @@ source_set("safe_browsing") { + ":archive_analyzer_results", + ":binary_feature_extractor", + ":download_type_util", +- ":rar_analyzer", + "//components/safe_browsing/core:features", + ] + +diff -up chromium-92.0.4515.107/chrome/common/safe_browsing/DEPS.nounrar chromium-92.0.4515.107/chrome/common/safe_browsing/DEPS +--- chromium-92.0.4515.107/chrome/common/safe_browsing/DEPS.nounrar 2021-07-19 14:45:10.000000000 -0400 ++++ chromium-92.0.4515.107/chrome/common/safe_browsing/DEPS 2021-07-26 16:44:53.670761825 -0400 +@@ -1,6 +1,5 @@ + include_rules = [ + "+components/safe_browsing", + "+third_party/protobuf", +- "+third_party/unrar", + "+third_party/zlib", + ] +diff -up chromium-92.0.4515.107/chrome/services/file_util/BUILD.gn.nounrar chromium-92.0.4515.107/chrome/services/file_util/BUILD.gn +--- chromium-92.0.4515.107/chrome/services/file_util/BUILD.gn.nounrar 2021-07-26 16:44:53.670761825 -0400 ++++ chromium-92.0.4515.107/chrome/services/file_util/BUILD.gn 2021-07-26 16:48:21.283924750 -0400 +@@ -50,7 +50,6 @@ source_set("file_util") { + deps += [ + "//chrome/common/safe_browsing", + "//chrome/common/safe_browsing:archive_analyzer_results", +- "//chrome/common/safe_browsing:rar_analyzer", + ] + } + +diff -up chromium-92.0.4515.107/chrome/services/file_util/safe_archive_analyzer.cc.nounrar chromium-92.0.4515.107/chrome/services/file_util/safe_archive_analyzer.cc +--- chromium-92.0.4515.107/chrome/services/file_util/safe_archive_analyzer.cc.nounrar 2021-07-19 14:45:11.000000000 -0400 ++++ chromium-92.0.4515.107/chrome/services/file_util/safe_archive_analyzer.cc 2021-07-26 16:44:53.670761825 -0400 +@@ -45,10 +45,14 @@ void SafeArchiveAnalyzer::AnalyzeDmgFile + void SafeArchiveAnalyzer::AnalyzeRarFile(base::File rar_file, + base::File temporary_file, + AnalyzeRarFileCallback callback) { ++#if 0 + DCHECK(rar_file.IsValid()); + + safe_browsing::ArchiveAnalyzerResults results; + safe_browsing::rar_analyzer::AnalyzeRarFile( + std::move(rar_file), std::move(temporary_file), &results); + std::move(callback).Run(results); ++#else ++ NOTREACHED(); ++#endif + } diff --git a/chromium-92.0.4515.107-py2-bootstrap.patch b/chromium-92.0.4515.107-py2-bootstrap.patch new file mode 100644 index 0000000..ea09033 --- /dev/null +++ b/chromium-92.0.4515.107-py2-bootstrap.patch @@ -0,0 +1,24 @@ +diff -up chromium-92.0.4515.107/third_party/catapult/common/py_vulcanize/py_vulcanize/generate.py.py2 chromium-92.0.4515.107/third_party/catapult/common/py_vulcanize/py_vulcanize/generate.py +--- chromium-92.0.4515.107/third_party/catapult/common/py_vulcanize/py_vulcanize/generate.py.py2 2021-07-19 14:47:19.000000000 -0400 ++++ chromium-92.0.4515.107/third_party/catapult/common/py_vulcanize/py_vulcanize/generate.py 2021-07-26 17:02:23.160750472 -0400 +@@ -83,7 +83,7 @@ def _MinifyJS(input_js): + + with tempfile.NamedTemporaryFile() as _: + args = [ +- 'python', ++ 'python2', + rjsmin_path + ] + p = subprocess.Popen(args, +diff -up chromium-92.0.4515.107/tools/gn/bootstrap/bootstrap.py.py2 chromium-92.0.4515.107/tools/gn/bootstrap/bootstrap.py +--- chromium-92.0.4515.107/tools/gn/bootstrap/bootstrap.py.py2 2021-07-19 14:45:43.000000000 -0400 ++++ chromium-92.0.4515.107/tools/gn/bootstrap/bootstrap.py 2021-07-26 17:02:23.160750472 -0400 +@@ -130,7 +130,7 @@ def main(argv): + if not options.debug: + gn_gen_args += ' is_debug=false' + subprocess.check_call([ +- gn_path, 'gen', out_dir, ++ gn_path, 'gen', out_dir, ' --script-executable=/usr/bin/python2', + '--args=%s' % gn_gen_args, "--root=" + SRC_ROOT + ]) + diff --git a/chromium-92.0.4515.107-rawhide-gcc-std-max-fix.patch b/chromium-92.0.4515.107-rawhide-gcc-std-max-fix.patch new file mode 100644 index 0000000..bfe17b9 --- /dev/null +++ b/chromium-92.0.4515.107-rawhide-gcc-std-max-fix.patch @@ -0,0 +1,13 @@ +diff -up chromium-92.0.4515.107/third_party/abseil-cpp/absl/debugging/failure_signal_handler.cc.sigstkszfix chromium-92.0.4515.107/third_party/abseil-cpp/absl/debugging/failure_signal_handler.cc +diff -up chromium-92.0.4515.107/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc.sigstkszfix chromium-92.0.4515.107/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc +--- chromium-92.0.4515.107/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc.sigstkszfix 2021-07-19 14:47:20.000000000 -0400 ++++ chromium-92.0.4515.107/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc 2021-07-26 17:28:50.155924005 -0400 +@@ -138,7 +138,7 @@ void InstallAlternateStackLocked() { + // SIGSTKSZ may be too small to prevent the signal handlers from overrunning + // the alternative stack. Ensure that the size of the alternative stack is + // large enough. +- static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ); ++ static const unsigned kSigStackSize = std::max(static_cast(16384), SIGSTKSZ); + + // Only set an alternative stack if there isn't already one, or if the current + // one is too small. diff --git a/chromium-92.0.4515.107-update-highway-0.12.2.patch b/chromium-92.0.4515.107-update-highway-0.12.2.patch new file mode 100644 index 0000000..fca308b --- /dev/null +++ b/chromium-92.0.4515.107-update-highway-0.12.2.patch @@ -0,0 +1,4199 @@ +diff -up chromium-92.0.4515.107/third_party/highway/src/CMakeLists.txt.in.update-highway-0.12.2 chromium-92.0.4515.107/third_party/highway/src/CMakeLists.txt.in +diff -up chromium-92.0.4515.107/third_party/highway/src/CMakeLists.txt.update-highway-0.12.2 chromium-92.0.4515.107/third_party/highway/src/CMakeLists.txt +--- chromium-92.0.4515.107/third_party/highway/src/CMakeLists.txt.update-highway-0.12.2 2021-07-19 14:47:23.000000000 -0400 ++++ chromium-92.0.4515.107/third_party/highway/src/CMakeLists.txt 2021-07-26 17:13:36.158002603 -0400 +@@ -19,7 +19,7 @@ if(POLICY CMP0083) + cmake_policy(SET CMP0083 NEW) + endif() + +-project(hwy VERSION 0.1) ++project(hwy VERSION 0.12.2) # Keep in sync with highway.h version + + set(CMAKE_CXX_STANDARD 11) + set(CMAKE_CXX_EXTENSIONS OFF) +@@ -40,6 +40,8 @@ if (NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE RelWithDebInfo) + endif() + ++set(HWY_CMAKE_ARM7 OFF CACHE BOOL "Set copts for ARMv7 with NEON?") ++ + include(CheckCXXSourceCompiles) + check_cxx_source_compiles( + "int main() { +@@ -51,10 +53,13 @@ check_cxx_source_compiles( + HWY_EMSCRIPTEN + ) + ++set(HWY_CONTRIB_SOURCES ++ hwy/contrib/image/image.cc ++ hwy/contrib/image/image.h ++ hwy/contrib/math/math-inl.h ++) ++ + set(HWY_SOURCES +- contrib/image/image.cc +- contrib/image/image.h +- contrib/math/math-inl.h + hwy/aligned_allocator.cc + hwy/aligned_allocator.h + hwy/base.h +@@ -64,6 +69,7 @@ set(HWY_SOURCES + hwy/nanobenchmark.cc + hwy/nanobenchmark.h + hwy/ops/arm_neon-inl.h ++ hwy/ops/arm_sve-inl.h + hwy/ops/scalar-inl.h + hwy/ops/set_macros-inl.h + hwy/ops/shared-inl.h +@@ -146,13 +152,28 @@ else() + -fno-exceptions + ) + endif() +-endif() ++ ++ if (HWY_CMAKE_ARM7) ++ list(APPEND HWY_FLAGS ++ -march=armv7-a ++ -mfpu=neon-vfpv4 ++ -mfloat-abi=hard # must match the toolchain specified as CXX= ++ -mfp16-format=ieee # required for vcvt_f32_f16 ++ ) ++ endif() # HWY_CMAKE_ARM7 ++ ++endif() # !MSVC + + add_library(hwy STATIC ${HWY_SOURCES}) + target_compile_options(hwy PRIVATE ${HWY_FLAGS}) + set_property(TARGET hwy PROPERTY POSITION_INDEPENDENT_CODE ON) + target_include_directories(hwy PUBLIC ${CMAKE_CURRENT_LIST_DIR}) + ++add_library(hwy_contrib STATIC ${HWY_CONTRIB_SOURCES}) ++target_compile_options(hwy_contrib PRIVATE ${HWY_FLAGS}) ++set_property(TARGET hwy_contrib PROPERTY POSITION_INDEPENDENT_CODE ON) ++target_include_directories(hwy_contrib PUBLIC ${CMAKE_CURRENT_LIST_DIR}) ++ + # -------------------------------------------------------- install library + install(TARGETS hwy + DESTINATION "${CMAKE_INSTALL_LIBDIR}") +@@ -166,9 +187,21 @@ foreach (source ${HWY_SOURCES}) + endif() + endforeach() + +-# Add a pkg-config file for libhwy and the test library. ++install(TARGETS hwy_contrib ++ DESTINATION "${CMAKE_INSTALL_LIBDIR}") ++# Install all the headers keeping the relative path to the current directory ++# when installing them. ++foreach (source ${HWY_CONTRIB_SOURCES}) ++ if ("${source}" MATCHES "\.h$") ++ get_filename_component(dirname "${source}" DIRECTORY) ++ install(FILES "${source}" ++ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${dirname}") ++ endif() ++endforeach() ++ ++# Add a pkg-config file for libhwy and the contrib/test libraries. + set(HWY_LIBRARY_VERSION "${CMAKE_PROJECT_VERSION}") +-foreach (pc libhwy.pc libhwy-test.pc) ++foreach (pc libhwy.pc libhwy-contrib.pc libhwy-test.pc) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${pc}.in" "${pc}" @ONLY) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${pc}" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") +@@ -251,8 +284,8 @@ endif() + endif() # HWY_SYSTEM_GTEST + + set(HWY_TEST_FILES +- contrib/image/image_test.cc +- # contrib/math/math_test.cc ++ hwy/contrib/image/image_test.cc ++ # hwy/contrib/math/math_test.cc + hwy/aligned_allocator_test.cc + hwy/base_test.cc + hwy/highway_test.cc +@@ -274,11 +307,16 @@ foreach (TESTFILE IN LISTS HWY_TEST_FILE + get_filename_component(TESTNAME ${TESTFILE} NAME_WE) + add_executable(${TESTNAME} ${TESTFILE}) + target_compile_options(${TESTNAME} PRIVATE ${HWY_FLAGS}) ++ # Test all targets, not just the best/baseline. This changes the default ++ # policy to all-attainable; note that setting -DHWY_COMPILE_* directly can ++ # cause compile errors because only one may be set, and other CMakeLists.txt ++ # that include us may set them. ++ target_compile_options(${TESTNAME} PRIVATE -DHWY_IS_TEST=1) + + if(HWY_SYSTEM_GTEST) +- target_link_libraries(${TESTNAME} hwy GTest::GTest GTest::Main) ++ target_link_libraries(${TESTNAME} hwy hwy_contrib GTest::GTest GTest::Main) + else() +- target_link_libraries(${TESTNAME} hwy gtest gtest_main) ++ target_link_libraries(${TESTNAME} hwy hwy_contrib gtest gtest_main) + endif() + # Output test targets in the test directory. + set_target_properties(${TESTNAME} PROPERTIES PREFIX "tests/") +diff -up chromium-92.0.4515.107/third_party/highway/src/debian/changelog.update-highway-0.12.2 chromium-92.0.4515.107/third_party/highway/src/debian/changelog +diff -up chromium-92.0.4515.107/third_party/highway/src/hwy/aligned_allocator.h.update-highway-0.12.2 chromium-92.0.4515.107/third_party/highway/src/hwy/aligned_allocator.h +--- chromium-92.0.4515.107/third_party/highway/src/hwy/aligned_allocator.h.update-highway-0.12.2 2021-07-19 14:47:23.000000000 -0400 ++++ chromium-92.0.4515.107/third_party/highway/src/hwy/aligned_allocator.h 2021-07-26 17:15:37.281847484 -0400 +@@ -111,6 +111,32 @@ AlignedUniquePtr MakeUniqueAligned(Ar + new (ptr) T(std::forward(args)...), AlignedDeleter()); + } + ++// Helpers for array allocators (avoids overflow) ++namespace detail { ++ ++// Returns x such that 1u << x == n (if n is a power of two). ++static inline constexpr size_t ShiftCount(size_t n) { ++ return (n <= 1) ? 0 : 1 + ShiftCount(n / 2); ++} ++ ++template ++T* AllocateAlignedItems(size_t items, AllocPtr alloc_ptr, void* opaque_ptr) { ++ constexpr size_t size = sizeof(T); ++ ++ constexpr bool is_pow2 = (size & (size - 1)) == 0; ++ constexpr size_t bits = ShiftCount(size); ++ static_assert(!is_pow2 || (1ull << bits) == size, "ShiftCount is incorrect"); ++ ++ const size_t bytes = is_pow2 ? items << bits : items * size; ++ const size_t check = is_pow2 ? bytes >> bits : bytes / size; ++ if (check != items) { ++ return nullptr; // overflowed ++ } ++ return static_cast(AllocateAlignedBytes(bytes, alloc_ptr, opaque_ptr)); ++} ++ ++} // namespace detail ++ + // Aligned memory equivalent of make_unique for array types using the + // custom allocators alloc/free. This function calls the constructor with the + // passed Args... on every created item. The destructor of each element will be +@@ -118,10 +144,11 @@ AlignedUniquePtr MakeUniqueAligned(Ar + template + AlignedUniquePtr MakeUniqueAlignedArrayWithAlloc( + size_t items, AllocPtr alloc, FreePtr free, void* opaque, Args&&... args) { +- T* ptr = +- static_cast(AllocateAlignedBytes(items * sizeof(T), alloc, opaque)); +- for (size_t i = 0; i < items; i++) { +- new (ptr + i) T(std::forward(args)...); ++ T* ptr = detail::AllocateAlignedItems(items, alloc, opaque); ++ if (ptr != nullptr) { ++ for (size_t i = 0; i < items; i++) { ++ new (ptr + i) T(std::forward(args)...); ++ } + } + return AlignedUniquePtr(ptr, AlignedDeleter(free, opaque)); + } +@@ -165,7 +192,7 @@ template + AlignedFreeUniquePtr AllocateAligned(const size_t items, AllocPtr alloc, + FreePtr free, void* opaque) { + return AlignedFreeUniquePtr( +- static_cast(AllocateAlignedBytes(items * sizeof(T), alloc, opaque)), ++ detail::AllocateAlignedItems(items, alloc, opaque), + AlignedFreer(free, opaque)); + } + +diff -up chromium-92.0.4515.107/third_party/highway/src/hwy/aligned_allocator_test.cc.update-highway-0.12.2 chromium-92.0.4515.107/third_party/highway/src/hwy/aligned_allocator_test.cc +--- chromium-92.0.4515.107/third_party/highway/src/hwy/aligned_allocator_test.cc.update-highway-0.12.2 2021-07-19 14:47:23.000000000 -0400 ++++ chromium-92.0.4515.107/third_party/highway/src/hwy/aligned_allocator_test.cc 2021-07-26 17:16:43.672858709 -0400 +@@ -16,6 +16,7 @@ + + #include + ++#include + #include + #include + #include +@@ -87,6 +88,32 @@ TEST(AlignedAllocatorTest, FreeNullptr) + /*opaque_ptr=*/nullptr); + } + ++TEST(AlignedAllocatorTest, Log2) { ++ EXPECT_EQ(0u, detail::ShiftCount(1)); ++ EXPECT_EQ(1u, detail::ShiftCount(2)); ++ EXPECT_EQ(3u, detail::ShiftCount(8)); ++} ++ ++// Allocator returns null when it detects overflow of items * sizeof(T). ++TEST(AlignedAllocatorTest, Overflow) { ++ constexpr size_t max = ~size_t(0); ++ constexpr size_t msb = (max >> 1) + 1; ++ using Size5 = std::array; ++ using Size10 = std::array; ++ EXPECT_EQ(nullptr, ++ detail::AllocateAlignedItems(max / 2, nullptr, nullptr)); ++ EXPECT_EQ(nullptr, ++ detail::AllocateAlignedItems(max / 3, nullptr, nullptr)); ++ EXPECT_EQ(nullptr, ++ detail::AllocateAlignedItems(max / 4, nullptr, nullptr)); ++ EXPECT_EQ(nullptr, ++ detail::AllocateAlignedItems(msb, nullptr, nullptr)); ++ EXPECT_EQ(nullptr, ++ detail::AllocateAlignedItems(msb + 1, nullptr, nullptr)); ++ EXPECT_EQ(nullptr, ++ detail::AllocateAlignedItems(msb / 4, nullptr, nullptr)); ++} ++ + TEST(AlignedAllocatorTest, AllocDefaultPointers) { + const size_t kSize = 7777; + void* ptr = AllocateAlignedBytes(kSize, /*alloc_ptr=*/nullptr, +@@ -215,7 +242,8 @@ TEST(AlignedAllocatorTest, MakeUniqueAli + auto arr = MakeUniqueAlignedArrayWithAlloc>( + 7, FakeAllocator::StaticAlloc, FakeAllocator::StaticFree, &fake_alloc, + &counter); +- // An array shold still only call a single allocation. ++ ASSERT_NE(nullptr, arr.get()); ++ // An array should still only call a single allocation. + EXPECT_EQ(1u, fake_alloc.PendingAllocs()); + EXPECT_EQ(7, counter); + for (size_t i = 0; i < 7; i++) { +diff -up chromium-92.0.4515.107/third_party/highway/src/hwy/base.h.update-highway-0.12.2 chromium-92.0.4515.107/third_party/highway/src/hwy/base.h +--- chromium-92.0.4515.107/third_party/highway/src/hwy/base.h.update-highway-0.12.2 2021-07-19 14:47:23.000000000 -0400 ++++ chromium-92.0.4515.107/third_party/highway/src/hwy/base.h 2021-07-26 17:16:04.753265910 -0400 +@@ -203,6 +203,10 @@ + #define HWY_ARCH_X86_64 0 + #endif + ++#if HWY_ARCH_X86_32 && HWY_ARCH_X86_64 ++#error "Cannot have both x86-32 and x86-64" ++#endif ++ + #if HWY_ARCH_X86_32 || HWY_ARCH_X86_64 + #define HWY_ARCH_X86 1 + #else +@@ -249,9 +253,11 @@ + #define HWY_ARCH_RVV 0 + #endif + ++// It is an error to detect multiple architectures at the same time, but OK to ++// detect none of the above. + #if (HWY_ARCH_X86 + HWY_ARCH_PPC + HWY_ARCH_ARM + HWY_ARCH_WASM + \ +- HWY_ARCH_RVV) != 1 +-#error "Must detect exactly one platform" ++ HWY_ARCH_RVV) > 1 ++#error "Must not detect more than one architecture" + #endif + + //------------------------------------------------------------------------------ +@@ -328,6 +334,12 @@ static constexpr HWY_MAYBE_UNUSED size_t + + // RVV already has a builtin type and the GCC intrinsics require it. + #if HWY_ARCH_RVV && HWY_COMPILER_GCC ++#define HWY_NATIVE_FLOAT16 1 ++#else ++#define HWY_NATIVE_FLOAT16 0 ++#endif ++ ++#if HWY_NATIVE_FLOAT16 + using float16_t = __fp16; + // Clang does not allow __fp16 arguments, but scalar.h requires LaneType + // arguments, so use a wrapper. +@@ -597,7 +609,7 @@ HWY_API size_t PopCount(uint64_t x) { + return static_cast(__builtin_popcountll(x)); + #elif HWY_COMPILER_MSVC && HWY_ARCH_X86_64 + return _mm_popcnt_u64(x); +-#elif HWY_COMPILER_MSVC ++#elif HWY_COMPILER_MSVC && HWY_ARCH_X86_32 + return _mm_popcnt_u32(uint32_t(x)) + _mm_popcnt_u32(uint32_t(x >> 32)); + #else + x -= ((x >> 1) & 0x55555555U); +diff -up chromium-92.0.4515.107/third_party/highway/src/hwy/cache_control.h.update-highway-0.12.2 chromium-92.0.4515.107/third_party/highway/src/hwy/cache_control.h +--- chromium-92.0.4515.107/third_party/highway/src/hwy/cache_control.h.update-highway-0.12.2 2021-07-19 14:47:23.000000000 -0400 ++++ chromium-92.0.4515.107/third_party/highway/src/hwy/cache_control.h 2021-07-26 17:16:26.004589594 -0400 +@@ -32,6 +32,14 @@ + #include // SSE2 + #endif + ++// Windows.h #defines these, which causes infinite recursion. Temporarily ++// undefine them in this header; these functions are anyway deprecated. ++// TODO(janwas): remove when these functions are removed. ++#pragma push_macro("LoadFence") ++#pragma push_macro("StoreFence") ++#undef LoadFence ++#undef StoreFence ++ + namespace hwy { + + // Even if N*sizeof(T) is smaller, Stream may write a multiple of this size. +@@ -83,6 +91,17 @@ HWY_INLINE HWY_ATTR_CACHE void FlushCach + #endif + } + ++// Reduces power consumption in spin-loops. No effect on non-x86. ++HWY_INLINE HWY_ATTR_CACHE void Pause() { ++#if HWY_ARCH_X86 && !defined(HWY_DISABLE_CACHE_CONTROL) ++ _mm_pause(); ++#endif ++} ++ + } // namespace hwy + ++// TODO(janwas): remove when these functions are removed. (See above.) ++#pragma pop_macro("StoreFence") ++#pragma pop_macro("LoadFence") ++ + #endif // HIGHWAY_HWY_CACHE_CONTROL_H_ +diff -up chromium-92.0.4515.107/third_party/highway/src/hwy/examples/skeleton.cc.update-highway-0.12.2 chromium-92.0.4515.107/third_party/highway/src/hwy/examples/skeleton.cc +diff -up chromium-92.0.4515.107/third_party/highway/src/hwy/examples/skeleton_test.cc.update-highway-0.12.2 chromium-92.0.4515.107/third_party/highway/src/hwy/examples/skeleton_test.cc +diff -up chromium-92.0.4515.107/third_party/highway/src/hwy/highway.h.update-highway-0.12.2 chromium-92.0.4515.107/third_party/highway/src/hwy/highway.h +--- chromium-92.0.4515.107/third_party/highway/src/hwy/highway.h.update-highway-0.12.2 2021-07-19 14:47:23.000000000 -0400 ++++ chromium-92.0.4515.107/third_party/highway/src/hwy/highway.h 2021-07-26 17:16:58.109078590 -0400 +@@ -25,10 +25,10 @@ + + namespace hwy { + +-// API version (https://semver.org/) ++// API version (https://semver.org/); keep in sync with CMakeLists.txt. + #define HWY_MAJOR 0 + #define HWY_MINOR 12 +-#define HWY_PATCH 0 ++#define HWY_PATCH 2 + + //------------------------------------------------------------------------------ + // Shorthand for descriptors (defined in shared-inl.h) used to select overloads. +@@ -49,7 +49,7 @@ namespace hwy { + HWY_FULL_RECOMPOSER((__VA_ARGS__, HWY_FULL2, HWY_FULL1, )) + #define HWY_FULL(...) HWY_CHOOSE_FULL(__VA_ARGS__())(__VA_ARGS__) + +-// Vector of up to MAX_N lanes. ++// Vector of up to MAX_N lanes. Discouraged, when possible, use Half<> instead. + #define HWY_CAPPED(T, MAX_N) \ + hwy::HWY_NAMESPACE::Simd + +@@ -75,6 +75,10 @@ namespace hwy { + #define HWY_STATIC_DISPATCH(FUNC_NAME) N_WASM::FUNC_NAME + #elif HWY_STATIC_TARGET == HWY_NEON + #define HWY_STATIC_DISPATCH(FUNC_NAME) N_NEON::FUNC_NAME ++#elif HWY_STATIC_TARGET == HWY_SVE ++#define HWY_STATIC_DISPATCH(FUNC_NAME) N_SVE::FUNC_NAME ++#elif HWY_STATIC_TARGET == HWY_SVE2 ++#define HWY_STATIC_DISPATCH(FUNC_NAME) N_SVE2::FUNC_NAME + #elif HWY_STATIC_TARGET == HWY_PPC8 + #define HWY_STATIC_DISPATCH(FUNC_NAME) N_PPC8::FUNC_NAME + #elif HWY_STATIC_TARGET == HWY_SSE4 +@@ -143,6 +147,18 @@ FunctionCache Function + #define HWY_CHOOSE_NEON(FUNC_NAME) nullptr + #endif + ++#if HWY_TARGETS & HWY_SVE ++#define HWY_CHOOSE_SVE(FUNC_NAME) &N_SVE::FUNC_NAME ++#else ++#define HWY_CHOOSE_SVE(FUNC_NAME) nullptr ++#endif ++ ++#if HWY_TARGETS & HWY_SVE2 ++#define HWY_CHOOSE_SVE2(FUNC_NAME) &N_SVE2::FUNC_NAME ++#else ++#define HWY_CHOOSE_SVE2(FUNC_NAME) nullptr ++#endif ++ + #if HWY_TARGETS & HWY_PPC8 + #define HWY_CHOOSE_PCC8(FUNC_NAME) &N_PPC8::FUNC_NAME + #else +@@ -261,8 +277,11 @@ FunctionCache Function + #elif HWY_TARGET == HWY_AVX3 + #include "hwy/ops/x86_512-inl.h" + #elif HWY_TARGET == HWY_PPC8 ++#error "PPC is not yet supported" + #elif HWY_TARGET == HWY_NEON + #include "hwy/ops/arm_neon-inl.h" ++#elif HWY_TARGET == HWY_SVE || HWY_TARGET == HWY_SVE2 ++#include "hwy/ops/arm_sve-inl.h" + #elif HWY_TARGET == HWY_WASM + #include "hwy/ops/wasm_128-inl.h" + #elif HWY_TARGET == HWY_RVV +diff -up chromium-92.0.4515.107/third_party/highway/src/hwy/nanobenchmark.cc.update-highway-0.12.2 chromium-92.0.4515.107/third_party/highway/src/hwy/nanobenchmark.cc +--- chromium-92.0.4515.107/third_party/highway/src/hwy/nanobenchmark.cc.update-highway-0.12.2 2021-07-19 14:47:23.000000000 -0400 ++++ chromium-92.0.4515.107/third_party/highway/src/hwy/nanobenchmark.cc 2021-07-26 17:17:12.094291603 -0400 +@@ -29,6 +29,22 @@ + #include + #include + ++#if defined(_WIN32) || defined(_WIN64) ++#ifndef NOMINMAX ++#define NOMINMAX ++#endif // NOMINMAX ++#include ++#endif ++ ++#if defined(__MACH__) ++#include ++#include ++#endif ++ ++#if defined(__HAIKU__) ++#include ++#endif ++ + #include "hwy/base.h" + #if HWY_ARCH_PPC + #include // NOLINT __ppc_get_timebase_freq +@@ -43,114 +59,13 @@ + #endif // HWY_ARCH_X86 + + namespace hwy { +-namespace platform { + namespace { +- +-#if HWY_ARCH_X86 +- +-void Cpuid(const uint32_t level, const uint32_t count, +- uint32_t* HWY_RESTRICT abcd) { +-#if HWY_COMPILER_MSVC +- int regs[4]; +- __cpuidex(regs, level, count); +- for (int i = 0; i < 4; ++i) { +- abcd[i] = regs[i]; +- } +-#else +- uint32_t a; +- uint32_t b; +- uint32_t c; +- uint32_t d; +- __cpuid_count(level, count, a, b, c, d); +- abcd[0] = a; +- abcd[1] = b; +- abcd[2] = c; +- abcd[3] = d; +-#endif +-} +- +-std::string BrandString() { +- char brand_string[49]; +- std::array abcd; +- +- // Check if brand string is supported (it is on all reasonable Intel/AMD) +- Cpuid(0x80000000U, 0, abcd.data()); +- if (abcd[0] < 0x80000004U) { +- return std::string(); +- } +- +- for (size_t i = 0; i < 3; ++i) { +- Cpuid(static_cast(0x80000002U + i), 0, abcd.data()); +- memcpy(brand_string + i * 16, abcd.data(), sizeof(abcd)); +- } +- brand_string[48] = 0; +- return brand_string; +-} +- +-// Returns the frequency quoted inside the brand string. This does not +-// account for throttling nor Turbo Boost. +-double NominalClockRate() { +- const std::string& brand_string = BrandString(); +- // Brand strings include the maximum configured frequency. These prefixes are +- // defined by Intel CPUID documentation. +- const char* prefixes[3] = {"MHz", "GHz", "THz"}; +- const double multipliers[3] = {1E6, 1E9, 1E12}; +- for (size_t i = 0; i < 3; ++i) { +- const size_t pos_prefix = brand_string.find(prefixes[i]); +- if (pos_prefix != std::string::npos) { +- const size_t pos_space = brand_string.rfind(' ', pos_prefix - 1); +- if (pos_space != std::string::npos) { +- const std::string digits = +- brand_string.substr(pos_space + 1, pos_prefix - pos_space - 1); +- return std::stod(digits) * multipliers[i]; +- } +- } +- } +- +- return 0.0; +-} +- +-#endif // HWY_ARCH_X86 +- +-} // namespace +- +-// Returns tick rate. Invariant means the tick counter frequency is independent +-// of CPU throttling or sleep. May be expensive, caller should cache the result. +-double InvariantTicksPerSecond() { +-#if HWY_ARCH_PPC +- return __ppc_get_timebase_freq(); +-#elif HWY_ARCH_X86 +- // We assume the TSC is invariant; it is on all recent Intel/AMD CPUs. +- return NominalClockRate(); +-#else +- // Fall back to clock_gettime nanoseconds. +- return 1E9; +-#endif +-} +- +-} // namespace platform +-namespace { +- +-// Prevents the compiler from eliding the computations that led to "output". +-template +-inline void PreventElision(T&& output) { +-#if HWY_COMPILER_MSVC == 0 +- // Works by indicating to the compiler that "output" is being read and +- // modified. The +r constraint avoids unnecessary writes to memory, but only +- // works for built-in types (typically FuncOutput). +- asm volatile("" : "+r"(output) : : "memory"); +-#else +- // MSVC does not support inline assembly anymore (and never supported GCC's +- // RTL constraints). Self-assignment with #pragma optimize("off") might be +- // expected to prevent elision, but it does not with MSVC 2015. Type-punning +- // with volatile pointers generates inefficient code on MSVC 2017. +- static std::atomic dummy(T{}); +- dummy.store(output, std::memory_order_relaxed); +-#endif +-} +- + namespace timer { + ++// Ticks := platform-specific timer values (CPU cycles on x86). Must be ++// unsigned to guarantee wraparound on overflow. ++using Ticks = uint64_t; ++ + // Start/Stop return absolute timestamps and must be placed immediately before + // and after the region to measure. We provide separate Start/Stop functions + // because they use different fences. +@@ -202,8 +117,8 @@ namespace timer { + + // Returns a 64-bit timestamp in unit of 'ticks'; to convert to seconds, + // divide by InvariantTicksPerSecond. +-inline uint64_t Start64() { +- uint64_t t; ++inline Ticks Start() { ++ Ticks t; + #if HWY_ARCH_PPC + asm volatile("mfspr %0, %1" : "=r"(t) : "i"(268)); + #elif HWY_ARCH_X86 && HWY_COMPILER_MSVC +@@ -228,8 +143,15 @@ inline uint64_t Start64() { + : "rdx", "memory", "cc"); + #elif HWY_ARCH_RVV + asm volatile("rdcycle %0" : "=r"(t)); +-#else +- // Fall back to OS - unsure how to reliably query cntvct_el0 frequency. ++#elif defined(_WIN32) || defined(_WIN64) ++ LARGE_INTEGER counter; ++ (void)QueryPerformanceCounter(&counter); ++ t = counter.QuadPart; ++#elif defined(__MACH__) ++ t = mach_absolute_time(); ++#elif defined(__HAIKU__) ++ t = system_time_nsecs(); // since boot ++#else // POSIX + timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + t = ts.tv_sec * 1000000000LL + ts.tv_nsec; +@@ -237,7 +159,7 @@ inline uint64_t Start64() { + return t; + } + +-inline uint64_t Stop64() { ++inline Ticks Stop() { + uint64_t t; + #if HWY_ARCH_PPC + asm volatile("mfspr %0, %1" : "=r"(t) : "i"(268)); +@@ -261,61 +183,7 @@ inline uint64_t Stop64() { + // "cc" = flags modified by SHL. + : "rcx", "rdx", "memory", "cc"); + #else +- t = Start64(); +-#endif +- return t; +-} +- +-// Returns a 32-bit timestamp with about 4 cycles less overhead than +-// Start64. Only suitable for measuring very short regions because the +-// timestamp overflows about once a second. +-inline uint32_t Start32() { +- uint32_t t; +-#if HWY_ARCH_X86 && HWY_COMPILER_MSVC +- _ReadWriteBarrier(); +- _mm_lfence(); +- _ReadWriteBarrier(); +- t = static_cast(__rdtsc()); +- _ReadWriteBarrier(); +- _mm_lfence(); +- _ReadWriteBarrier(); +-#elif HWY_ARCH_X86_64 +- asm volatile( +- "lfence\n\t" +- "rdtsc\n\t" +- "lfence" +- : "=a"(t) +- : +- // "memory" avoids reordering. rdx = TSC >> 32. +- : "rdx", "memory"); +-#elif HWY_ARCH_RVV +- asm volatile("rdcycle %0" : "=r"(t)); +-#else +- t = static_cast(Start64()); +-#endif +- return t; +-} +- +-inline uint32_t Stop32() { +- uint32_t t; +-#if HWY_ARCH_X86 && HWY_COMPILER_MSVC +- _ReadWriteBarrier(); +- unsigned aux; +- t = static_cast(__rdtscp(&aux)); +- _ReadWriteBarrier(); +- _mm_lfence(); +- _ReadWriteBarrier(); +-#elif HWY_ARCH_X86_64 +- // Use inline asm because __rdtscp generates code to store TSC_AUX (ecx). +- asm volatile( +- "rdtscp\n\t" +- "lfence" +- : "=a"(t) +- : +- // "memory" avoids reordering. rcx = TSC_AUX. rdx = TSC >> 32. +- : "rcx", "rdx", "memory"); +-#else +- t = static_cast(Stop64()); ++ t = Start(); + #endif + return t; + } +@@ -440,21 +308,130 @@ T MedianAbsoluteDeviation(const T* value + } + + } // namespace robust_statistics ++} // namespace ++namespace platform { ++namespace { + +-// Ticks := platform-specific timer values (CPU cycles on x86). Must be +-// unsigned to guarantee wraparound on overflow. 32 bit timers are faster to +-// read than 64 bit. +-using Ticks = uint32_t; ++// Prevents the compiler from eliding the computations that led to "output". ++template ++inline void PreventElision(T&& output) { ++#if HWY_COMPILER_MSVC == 0 ++ // Works by indicating to the compiler that "output" is being read and ++ // modified. The +r constraint avoids unnecessary writes to memory, but only ++ // works for built-in types (typically FuncOutput). ++ asm volatile("" : "+r"(output) : : "memory"); ++#else ++ // MSVC does not support inline assembly anymore (and never supported GCC's ++ // RTL constraints). Self-assignment with #pragma optimize("off") might be ++ // expected to prevent elision, but it does not with MSVC 2015. Type-punning ++ // with volatile pointers generates inefficient code on MSVC 2017. ++ static std::atomic dummy(T{}); ++ dummy.store(output, std::memory_order_relaxed); ++#endif ++} ++ ++#if HWY_ARCH_X86 ++ ++void Cpuid(const uint32_t level, const uint32_t count, ++ uint32_t* HWY_RESTRICT abcd) { ++#if HWY_COMPILER_MSVC ++ int regs[4]; ++ __cpuidex(regs, level, count); ++ for (int i = 0; i < 4; ++i) { ++ abcd[i] = regs[i]; ++ } ++#else ++ uint32_t a; ++ uint32_t b; ++ uint32_t c; ++ uint32_t d; ++ __cpuid_count(level, count, a, b, c, d); ++ abcd[0] = a; ++ abcd[1] = b; ++ abcd[2] = c; ++ abcd[3] = d; ++#endif ++} ++ ++std::string BrandString() { ++ char brand_string[49]; ++ std::array abcd; ++ ++ // Check if brand string is supported (it is on all reasonable Intel/AMD) ++ Cpuid(0x80000000U, 0, abcd.data()); ++ if (abcd[0] < 0x80000004U) { ++ return std::string(); ++ } ++ ++ for (size_t i = 0; i < 3; ++i) { ++ Cpuid(static_cast(0x80000002U + i), 0, abcd.data()); ++ memcpy(brand_string + i * 16, abcd.data(), sizeof(abcd)); ++ } ++ brand_string[48] = 0; ++ return brand_string; ++} ++ ++// Returns the frequency quoted inside the brand string. This does not ++// account for throttling nor Turbo Boost. ++double NominalClockRate() { ++ const std::string& brand_string = BrandString(); ++ // Brand strings include the maximum configured frequency. These prefixes are ++ // defined by Intel CPUID documentation. ++ const char* prefixes[3] = {"MHz", "GHz", "THz"}; ++ const double multipliers[3] = {1E6, 1E9, 1E12}; ++ for (size_t i = 0; i < 3; ++i) { ++ const size_t pos_prefix = brand_string.find(prefixes[i]); ++ if (pos_prefix != std::string::npos) { ++ const size_t pos_space = brand_string.rfind(' ', pos_prefix - 1); ++ if (pos_space != std::string::npos) { ++ const std::string digits = ++ brand_string.substr(pos_space + 1, pos_prefix - pos_space - 1); ++ return std::stod(digits) * multipliers[i]; ++ } ++ } ++ } ++ ++ return 0.0; ++} ++ ++#endif // HWY_ARCH_X86 ++ ++} // namespace ++ ++double InvariantTicksPerSecond() { ++#if HWY_ARCH_PPC ++ return __ppc_get_timebase_freq(); ++#elif HWY_ARCH_X86 ++ // We assume the TSC is invariant; it is on all recent Intel/AMD CPUs. ++ return NominalClockRate(); ++#elif defined(_WIN32) || defined(_WIN64) ++ LARGE_INTEGER freq; ++ (void)QueryPerformanceFrequency(&freq); ++ return double(freq.QuadPart); ++#elif defined(__MACH__) ++ // https://developer.apple.com/library/mac/qa/qa1398/_index.html ++ mach_timebase_info_data_t timebase; ++ (void)mach_timebase_info(&timebase); ++ return double(timebase.denom) / timebase.numer * 1E9; ++#else ++ // TODO(janwas): ARM? Unclear how to reliably query cntvct_el0 frequency. ++ return 1E9; // Haiku and clock_gettime return nanoseconds. ++#endif ++} + +-// Returns timer overhead / minimum measurable difference. +-Ticks TimerResolution() { ++double Now() { ++ static const double mul = 1.0 / InvariantTicksPerSecond(); ++ return static_cast(timer::Start()) * mul; ++} ++ ++uint64_t TimerResolution() { + // Nested loop avoids exceeding stack/L1 capacity. +- Ticks repetitions[Params::kTimerSamples]; ++ timer::Ticks repetitions[Params::kTimerSamples]; + for (size_t rep = 0; rep < Params::kTimerSamples; ++rep) { +- Ticks samples[Params::kTimerSamples]; ++ timer::Ticks samples[Params::kTimerSamples]; + for (size_t i = 0; i < Params::kTimerSamples; ++i) { +- const Ticks t0 = timer::Start32(); +- const Ticks t1 = timer::Stop32(); ++ const timer::Ticks t0 = timer::Start(); ++ const timer::Ticks t1 = timer::Stop(); + samples[i] = t1 - t0; + } + repetitions[rep] = robust_statistics::Mode(samples); +@@ -462,18 +439,21 @@ Ticks TimerResolution() { + return robust_statistics::Mode(repetitions); + } + +-static const Ticks timer_resolution = TimerResolution(); ++} // namespace platform ++namespace { ++ ++static const timer::Ticks timer_resolution = platform::TimerResolution(); + + // Estimates the expected value of "lambda" values with a variable number of + // samples until the variability "rel_mad" is less than "max_rel_mad". + template +-Ticks SampleUntilStable(const double max_rel_mad, double* rel_mad, +- const Params& p, const Lambda& lambda) { ++timer::Ticks SampleUntilStable(const double max_rel_mad, double* rel_mad, ++ const Params& p, const Lambda& lambda) { + // Choose initial samples_per_eval based on a single estimated duration. +- Ticks t0 = timer::Start32(); ++ timer::Ticks t0 = timer::Start(); + lambda(); +- Ticks t1 = timer::Stop32(); +- Ticks est = t1 - t0; ++ timer::Ticks t1 = timer::Stop(); ++ timer::Ticks est = t1 - t0; + static const double ticks_per_second = platform::InvariantTicksPerSecond(); + const size_t ticks_per_eval = + static_cast(ticks_per_second * p.seconds_per_eval); +@@ -481,21 +461,21 @@ Ticks SampleUntilStable(const double max + est == 0 ? p.min_samples_per_eval : ticks_per_eval / est; + samples_per_eval = std::max(samples_per_eval, p.min_samples_per_eval); + +- std::vector samples; ++ std::vector samples; + samples.reserve(1 + samples_per_eval); + samples.push_back(est); + + // Percentage is too strict for tiny differences, so also allow a small + // absolute "median absolute deviation". +- const Ticks max_abs_mad = (timer_resolution + 99) / 100; ++ const timer::Ticks max_abs_mad = (timer_resolution + 99) / 100; + *rel_mad = 0.0; // ensure initialized + + for (size_t eval = 0; eval < p.max_evals; ++eval, samples_per_eval *= 2) { + samples.reserve(samples.size() + samples_per_eval); + for (size_t i = 0; i < samples_per_eval; ++i) { +- t0 = timer::Start32(); ++ t0 = timer::Start(); + lambda(); +- t1 = timer::Stop32(); ++ t1 = timer::Stop(); + samples.push_back(t1 - t0); + } + +@@ -508,14 +488,14 @@ Ticks SampleUntilStable(const double max + NANOBENCHMARK_CHECK(est != 0); + + // Median absolute deviation (mad) is a robust measure of 'variability'. +- const Ticks abs_mad = robust_statistics::MedianAbsoluteDeviation( ++ const timer::Ticks abs_mad = robust_statistics::MedianAbsoluteDeviation( + samples.data(), samples.size(), est); +- *rel_mad = static_cast(int(abs_mad)) / est; ++ *rel_mad = static_cast(abs_mad) / static_cast(est); + + if (*rel_mad <= max_rel_mad || abs_mad <= max_abs_mad) { + if (p.verbose) { +- printf("%6zu samples => %5u (abs_mad=%4u, rel_mad=%4.2f%%)\n", +- samples.size(), est, abs_mad, *rel_mad * 100.0); ++ printf("%6zu samples => %5zu (abs_mad=%4zu, rel_mad=%4.2f%%)\n", ++ samples.size(), size_t(est), size_t(abs_mad), *rel_mad * 100.0); + } + return est; + } +@@ -539,29 +519,17 @@ InputVec UniqueInputs(const FuncInput* i + return unique; + } + +-// Returns how often we need to call func for sufficient precision, or zero +-// on failure (e.g. the elapsed time is too long for a 32-bit tick count). ++// Returns how often we need to call func for sufficient precision. + size_t NumSkip(const Func func, const uint8_t* arg, const InputVec& unique, + const Params& p) { + // Min elapsed ticks for any input. +- Ticks min_duration = ~0u; ++ timer::Ticks min_duration = ~timer::Ticks(0); + + for (const FuncInput input : unique) { +- // Make sure a 32-bit timer is sufficient. +- const uint64_t t0 = timer::Start64(); +- PreventElision(func(arg, input)); +- const uint64_t t1 = timer::Stop64(); +- const uint64_t elapsed = t1 - t0; +- if (elapsed >= (1ULL << 30)) { +- fprintf(stderr, "Measurement failed: need 64-bit timer for input=%zu\n", +- input); +- return 0; +- } +- + double rel_mad; +- const Ticks total = SampleUntilStable( ++ const timer::Ticks total = SampleUntilStable( + p.target_rel_mad, &rel_mad, p, +- [func, arg, input]() { PreventElision(func(arg, input)); }); ++ [func, arg, input]() { platform::PreventElision(func(arg, input)); }); + min_duration = std::min(min_duration, total - timer_resolution); + } + +@@ -571,8 +539,8 @@ size_t NumSkip(const Func func, const ui + const size_t num_skip = + min_duration == 0 ? 0 : (max_skip + min_duration - 1) / min_duration; + if (p.verbose) { +- printf("res=%u max_skip=%zu min_dur=%u num_skip=%zu\n", timer_resolution, +- max_skip, min_duration, num_skip); ++ printf("res=%zu max_skip=%zu min_dur=%zu num_skip=%zu\n", ++ size_t(timer_resolution), max_skip, size_t(min_duration), num_skip); + } + return num_skip; + } +@@ -637,13 +605,14 @@ void FillSubset(const InputVec& full, co + } + + // Returns total ticks elapsed for all inputs. +-Ticks TotalDuration(const Func func, const uint8_t* arg, const InputVec* inputs, +- const Params& p, double* max_rel_mad) { ++timer::Ticks TotalDuration(const Func func, const uint8_t* arg, ++ const InputVec* inputs, const Params& p, ++ double* max_rel_mad) { + double rel_mad; +- const Ticks duration = ++ const timer::Ticks duration = + SampleUntilStable(p.target_rel_mad, &rel_mad, p, [func, arg, inputs]() { + for (const FuncInput input : *inputs) { +- PreventElision(func(arg, input)); ++ platform::PreventElision(func(arg, input)); + } + }); + *max_rel_mad = std::max(*max_rel_mad, rel_mad); +@@ -657,19 +626,20 @@ HWY_NOINLINE FuncOutput EmptyFunc(const + + // Returns overhead of accessing inputs[] and calling a function; this will + // be deducted from future TotalDuration return values. +-Ticks Overhead(const uint8_t* arg, const InputVec* inputs, const Params& p) { ++timer::Ticks Overhead(const uint8_t* arg, const InputVec* inputs, ++ const Params& p) { + double rel_mad; + // Zero tolerance because repeatability is crucial and EmptyFunc is fast. + return SampleUntilStable(0.0, &rel_mad, p, [arg, inputs]() { + for (const FuncInput input : *inputs) { +- PreventElision(EmptyFunc(arg, input)); ++ platform::PreventElision(EmptyFunc(arg, input)); + } + }); + } + + } // namespace + +-int Unpredictable1() { return timer::Start64() != ~0ULL; } ++int Unpredictable1() { return timer::Start() != ~0ULL; } + + size_t Measure(const Func func, const uint8_t* arg, const FuncInput* inputs, + const size_t num_inputs, Result* results, const Params& p) { +@@ -685,32 +655,35 @@ size_t Measure(const Func func, const ui + ReplicateInputs(inputs, num_inputs, unique.size(), num_skip, p); + InputVec subset(full.size() - num_skip); + +- const Ticks overhead = Overhead(arg, &full, p); +- const Ticks overhead_skip = Overhead(arg, &subset, p); ++ const timer::Ticks overhead = Overhead(arg, &full, p); ++ const timer::Ticks overhead_skip = Overhead(arg, &subset, p); + if (overhead < overhead_skip) { +- fprintf(stderr, "Measurement failed: overhead %u < %u\n", overhead, +- overhead_skip); ++ fprintf(stderr, "Measurement failed: overhead %zu < %zu\n", ++ size_t(overhead), size_t(overhead_skip)); + return 0; + } + + if (p.verbose) { +- printf("#inputs=%5zu,%5zu overhead=%5u,%5u\n", full.size(), subset.size(), +- overhead, overhead_skip); ++ printf("#inputs=%5zu,%5zu overhead=%5zu,%5zu\n", full.size(), subset.size(), ++ size_t(overhead), size_t(overhead_skip)); + } + + double max_rel_mad = 0.0; +- const Ticks total = TotalDuration(func, arg, &full, p, &max_rel_mad); ++ const timer::Ticks total = TotalDuration(func, arg, &full, p, &max_rel_mad); + + for (size_t i = 0; i < unique.size(); ++i) { + FillSubset(full, unique[i], num_skip, &subset); +- const Ticks total_skip = TotalDuration(func, arg, &subset, p, &max_rel_mad); ++ const timer::Ticks total_skip = ++ TotalDuration(func, arg, &subset, p, &max_rel_mad); + + if (total < total_skip) { +- fprintf(stderr, "Measurement failed: total %u < %u\n", total, total_skip); ++ fprintf(stderr, "Measurement failed: total %zu < %zu\n", size_t(total), ++ size_t(total_skip)); + return 0; + } + +- const Ticks duration = (total - overhead) - (total_skip - overhead_skip); ++ const timer::Ticks duration = ++ (total - overhead) - (total_skip - overhead_skip); + results[i].input = unique[i]; + results[i].ticks = static_cast(duration) * mul; + results[i].variability = static_cast(max_rel_mad); +diff -up chromium-92.0.4515.107/third_party/highway/src/hwy/nanobenchmark.h.update-highway-0.12.2 chromium-92.0.4515.107/third_party/highway/src/hwy/nanobenchmark.h +--- chromium-92.0.4515.107/third_party/highway/src/hwy/nanobenchmark.h.update-highway-0.12.2 2021-07-19 14:47:23.000000000 -0400 ++++ chromium-92.0.4515.107/third_party/highway/src/hwy/nanobenchmark.h 2021-07-26 17:17:12.094291603 -0400 +@@ -44,11 +44,6 @@ + // central tendency of the measurement samples with the "half sample mode", + // which is more robust to outliers and skewed data than the mean or median. + +-// WARNING if included from multiple translation units compiled with distinct +-// flags: this header requires textual inclusion and a predefined NB_NAMESPACE +-// macro that is unique to the current compile flags. We must also avoid +-// standard library headers such as vector and functional that define functions. +- + #include + #include + +@@ -79,6 +74,16 @@ namespace platform { + // This call may be expensive, callers should cache the result. + double InvariantTicksPerSecond(); + ++// Returns current timestamp [in seconds] relative to an unspecified origin. ++// Features: monotonic (no negative elapsed time), steady (unaffected by system ++// time changes), high-resolution (on the order of microseconds). ++double Now(); ++ ++// Returns ticks elapsed in back to back timer calls, i.e. a function of the ++// timer resolution (minimum measurable difference) and overhead. ++// This call is expensive, callers should cache the result. ++uint64_t TimerResolution(); ++ + } // namespace platform + + // Returns 1, but without the compiler knowing what the value is. This prevents +diff -up chromium-92.0.4515.107/third_party/highway/src/hwy/nanobenchmark_test.cc.update-highway-0.12.2 chromium-92.0.4515.107/third_party/highway/src/hwy/nanobenchmark_test.cc +--- chromium-92.0.4515.107/third_party/highway/src/hwy/nanobenchmark_test.cc.update-highway-0.12.2 2021-07-19 14:47:23.000000000 -0400 ++++ chromium-92.0.4515.107/third_party/highway/src/hwy/nanobenchmark_test.cc 2021-07-26 17:10:30.283171481 -0400 +@@ -15,11 +15,11 @@ + #include "hwy/nanobenchmark.h" + + #include +-#include // strtol +-#include // sleep + + #include + ++#include "hwy/tests/test_util-inl.h" ++ + namespace hwy { + namespace { + +@@ -31,6 +31,7 @@ FuncOutput Div(const void*, FuncInput in + + template + void MeasureDiv(const FuncInput (&inputs)[N]) { ++ printf("Measuring integer division (output on final two lines)\n"); + Result results[N]; + Params params; + params.max_evals = 4; // avoid test timeout +@@ -66,39 +67,14 @@ void MeasureRandom(const FuncInput (&inp + } + } + +-template +-void EnsureLongMeasurementFails(const FuncInput (&inputs)[N]) { +- printf("Expect a 'measurement failed' below:\n"); +- Result results[N]; +- +- const size_t num_results = Measure( +- [](const void*, const FuncInput input) -> FuncOutput { +- // Loop until the sleep succeeds (not interrupted by signal). We assume +- // >= 512 MHz, so 2 seconds will exceed the 1 << 30 tick safety limit. +- while (sleep(2) != 0) { +- } +- return input; +- }, +- nullptr, inputs, N, results); +- NANOBENCHMARK_CHECK(num_results == 0); +- (void)num_results; +-} +- +-void RunAll(const int argc, char** /*argv*/) { +- // unpredictable == 1 but the compiler doesn't know that. +- const int unpredictable = argc != 999; ++TEST(NanobenchmarkTest, RunAll) { ++ const int unpredictable = Unpredictable1(); // == 1, unknown to compiler. + static const FuncInput inputs[] = {static_cast(unpredictable) + 2, + static_cast(unpredictable + 9)}; + + MeasureDiv(inputs); + MeasureRandom(inputs); +- EnsureLongMeasurementFails(inputs); + } + + } // namespace + } // namespace hwy +- +-int main(int argc, char* argv[]) { +- hwy::RunAll(argc, argv); +- return 0; +-} +diff -up chromium-92.0.4515.107/third_party/highway/src/hwy/ops/arm_neon-inl.h.update-highway-0.12.2 chromium-92.0.4515.107/third_party/highway/src/hwy/ops/arm_neon-inl.h +--- chromium-92.0.4515.107/third_party/highway/src/hwy/ops/arm_neon-inl.h.update-highway-0.12.2 2021-07-19 14:47:23.000000000 -0400 ++++ chromium-92.0.4515.107/third_party/highway/src/hwy/ops/arm_neon-inl.h 2021-07-26 17:20:19.294142914 -0400 +@@ -26,6 +26,8 @@ HWY_BEFORE_NAMESPACE(); + namespace hwy { + namespace HWY_NAMESPACE { + ++namespace detail { // for code folding and Raw128 ++ + // Macros used to define single and double function calls for multiple types + // for full and half vectors. These macros are undefined at the end of the file. + +@@ -437,12 +439,14 @@ struct Raw128 { + using type = int8x8_t; + }; + ++} // namespace detail ++ + template + using Full128 = Simd; + + template + class Vec128 { +- using Raw = typename Raw128::type; ++ using Raw = typename detail::Raw128::type; + + public: + HWY_INLINE Vec128() {} +@@ -480,7 +484,8 @@ class Vec128 { + // FF..FF or 0, also for floating-point - see README. + template + class Mask128 { +- using Raw = typename Raw128::type; ++ // ARM C Language Extensions return and expect unsigned type. ++ using Raw = typename detail::Raw128, N>::type; + + public: + HWY_INLINE Mask128() {} +@@ -664,15 +669,25 @@ template + HWY_INLINE Vec128 Undefined(Simd /*d*/) { + HWY_DIAGNOSTICS(push) + HWY_DIAGNOSTICS_OFF(disable : 4701, ignored "-Wuninitialized") +- typename Raw128::type a; ++ typename detail::Raw128::type a; + return Vec128(a); + HWY_DIAGNOSTICS(pop) + } + +-// ------------------------------ Extract lane ++// Returns a vector with lane i=[0, N) set to "first" + i. ++template ++Vec128 Iota(const Simd d, const T2 first) { ++ HWY_ALIGN T lanes[16 / sizeof(T)]; ++ for (size_t i = 0; i < 16 / sizeof(T); ++i) { ++ lanes[i] = static_cast(first + static_cast(i)); ++ } ++ return Load(d, lanes); ++} ++ ++// ------------------------------ GetLane + + HWY_INLINE uint8_t GetLane(const Vec128 v) { +- return vget_lane_u8(vget_low_u8(v.raw), 0); ++ return vgetq_lane_u8(v.raw, 0); + } + template + HWY_INLINE uint8_t GetLane(const Vec128 v) { +@@ -680,7 +695,7 @@ HWY_INLINE uint8_t GetLane(const Vec128< + } + + HWY_INLINE int8_t GetLane(const Vec128 v) { +- return vget_lane_s8(vget_low_s8(v.raw), 0); ++ return vgetq_lane_s8(v.raw, 0); + } + template + HWY_INLINE int8_t GetLane(const Vec128 v) { +@@ -688,7 +703,7 @@ HWY_INLINE int8_t GetLane(const Vec128 v) { +- return vget_lane_u16(vget_low_u16(v.raw), 0); ++ return vgetq_lane_u16(v.raw, 0); + } + template + HWY_INLINE uint16_t GetLane(const Vec128 v) { +@@ -696,7 +711,7 @@ HWY_INLINE uint16_t GetLane(const Vec128 + } + + HWY_INLINE int16_t GetLane(const Vec128 v) { +- return vget_lane_s16(vget_low_s16(v.raw), 0); ++ return vgetq_lane_s16(v.raw, 0); + } + template + HWY_INLINE int16_t GetLane(const Vec128 v) { +@@ -704,7 +719,7 @@ HWY_INLINE int16_t GetLane(const Vec128< + } + + HWY_INLINE uint32_t GetLane(const Vec128 v) { +- return vget_lane_u32(vget_low_u32(v.raw), 0); ++ return vgetq_lane_u32(v.raw, 0); + } + template + HWY_INLINE uint32_t GetLane(const Vec128 v) { +@@ -712,7 +727,7 @@ HWY_INLINE uint32_t GetLane(const Vec128 + } + + HWY_INLINE int32_t GetLane(const Vec128 v) { +- return vget_lane_s32(vget_low_s32(v.raw), 0); ++ return vgetq_lane_s32(v.raw, 0); + } + template + HWY_INLINE int32_t GetLane(const Vec128 v) { +@@ -720,20 +735,20 @@ HWY_INLINE int32_t GetLane(const Vec128< + } + + HWY_INLINE uint64_t GetLane(const Vec128 v) { +- return vget_lane_u64(vget_low_u64(v.raw), 0); ++ return vgetq_lane_u64(v.raw, 0); + } + HWY_INLINE uint64_t GetLane(const Vec128 v) { + return vget_lane_u64(v.raw, 0); + } + HWY_INLINE int64_t GetLane(const Vec128 v) { +- return vget_lane_s64(vget_low_s64(v.raw), 0); ++ return vgetq_lane_s64(v.raw, 0); + } + HWY_INLINE int64_t GetLane(const Vec128 v) { + return vget_lane_s64(v.raw, 0); + } + + HWY_INLINE float GetLane(const Vec128 v) { +- return vget_lane_f32(vget_low_f32(v.raw), 0); ++ return vgetq_lane_f32(v.raw, 0); + } + HWY_INLINE float GetLane(const Vec128 v) { + return vget_lane_f32(v.raw, 0); +@@ -743,7 +758,7 @@ HWY_INLINE float GetLane(const Vec128 v) { +- return vget_lane_f64(vget_low_f64(v.raw), 0); ++ return vgetq_lane_f64(v.raw, 0); + } + HWY_INLINE double GetLane(const Vec128 v) { + return vget_lane_f64(v.raw, 0); +@@ -785,8 +800,6 @@ HWY_NEON_DEF_FUNCTION_INT_64(SaturatedSu + // ------------------------------ Average + + // Returns (a + b + 1) / 2 +- +-// Unsigned + HWY_NEON_DEF_FUNCTION_UINT_8(AverageRound, vrhadd, _, 2) + HWY_NEON_DEF_FUNCTION_UINT_16(AverageRound, vrhadd, _, 2) + +@@ -802,6 +815,7 @@ HWY_INLINE Vec128 Abs(const Vec + HWY_INLINE Vec128 Abs(const Vec128 v) { + return Vec128(vabsq_s32(v.raw)); + } ++// i64 is implemented after BroadcastSignBit. + HWY_INLINE Vec128 Abs(const Vec128 v) { + return Vec128(vabsq_f32(v.raw)); + } +@@ -1184,21 +1198,34 @@ HWY_INLINE Vec128 ApproximateR + #if HWY_ARCH_ARM_A64 + HWY_NEON_DEF_FUNCTION_ALL_FLOATS(operator/, vdiv, _, 2) + #else +-// Emulated with approx reciprocal + Newton-Raphson + mul ++// Not defined on armv7: approximate ++namespace detail { ++ ++HWY_INLINE Vec128 ReciprocalNewtonRaphsonStep( ++ const Vec128 recip, const Vec128 divisor) { ++ return Vec128(vrecpsq_f32(recip.raw, divisor.raw)); ++} ++template ++HWY_INLINE Vec128 ReciprocalNewtonRaphsonStep( ++ const Vec128 recip, Vec128 divisor) { ++ return Vec128(vrecps_f32(recip.raw, divisor.raw)); ++} ++ ++} // namespace detail ++ + template + HWY_INLINE Vec128 operator/(const Vec128 a, + const Vec128 b) { + auto x = ApproximateReciprocal(b); +- // Newton-Raphson on 1/x - b +- const auto two = Set(Simd(), 2); +- x = x * (two - b * x); +- x = x * (two - b * x); +- x = x * (two - b * x); ++ x *= detail::ReciprocalNewtonRaphsonStep(x, b); ++ x *= detail::ReciprocalNewtonRaphsonStep(x, b); ++ x *= detail::ReciprocalNewtonRaphsonStep(x, b); + return a * x; + } + #endif + +-// Absolute value of difference. ++// ------------------------------ Absolute value of difference. ++ + HWY_INLINE Vec128 AbsDiff(const Vec128 a, const Vec128 b) { + return Vec128(vabdq_f32(a.raw, b.raw)); + } +@@ -1312,7 +1339,7 @@ HWY_INLINE Vec128 NegMulSub(c + } + #endif + +-// ------------------------------ Floating-point square root ++// ------------------------------ Floating-point square root (IfThenZeroElse) + + // Approximate reciprocal square root + HWY_INLINE Vec128 ApproximateReciprocalSqrt(const Vec128 v) { +@@ -1328,77 +1355,33 @@ HWY_INLINE Vec128 ApproximateR + #if HWY_ARCH_ARM_A64 + HWY_NEON_DEF_FUNCTION_ALL_FLOATS(Sqrt, vsqrt, _, 1) + #else +-// Not defined on armv7: emulate with approx reciprocal sqrt + Goldschmidt. +-template +-HWY_INLINE Vec128 Sqrt(const Vec128 v) { +- auto b = v; +- auto Y = ApproximateReciprocalSqrt(v); +- auto x = v * Y; +- const auto half = Set(Simd(), 0.5); +- const auto oneandhalf = Set(Simd(), 1.5); +- for (size_t i = 0; i < 3; i++) { +- b = b * Y * Y; +- Y = oneandhalf - half * b; +- x = x * Y; +- } +- return IfThenZeroElse(v == Zero(Simd()), x); +-} +-#endif +- +-// ================================================== COMPARE +- +-// Comparisons fill a lane with 1-bits if the condition is true, else 0. ++namespace detail { + +-template +-HWY_API Mask128 RebindMask(Simd /*tag*/, Mask128 m) { +- static_assert(sizeof(TFrom) == sizeof(TTo), "Must have same size"); +- return Mask128{m.raw}; ++HWY_INLINE Vec128 ReciprocalSqrtStep(const Vec128 root, ++ const Vec128 recip) { ++ return Vec128(vrsqrtsq_f32(root.raw, recip.raw)); ++} ++template ++HWY_INLINE Vec128 ReciprocalSqrtStep(const Vec128 root, ++ Vec128 recip) { ++ return Vec128(vrsqrts_f32(root.raw, recip.raw)); + } + +-#define HWY_NEON_BUILD_TPL_HWY_COMPARE +-#define HWY_NEON_BUILD_RET_HWY_COMPARE(type, size) Mask128 +-#define HWY_NEON_BUILD_PARAM_HWY_COMPARE(type, size) \ +- const Vec128 a, const Vec128 b +-#define HWY_NEON_BUILD_ARG_HWY_COMPARE a.raw, b.raw +- +-// ------------------------------ Equality +-HWY_NEON_DEF_FUNCTION_ALL_FLOATS(operator==, vceq, _, HWY_COMPARE) +-#if HWY_ARCH_ARM_A64 +-HWY_NEON_DEF_FUNCTION_INTS_UINTS(operator==, vceq, _, HWY_COMPARE) +-#else +-// No 64-bit comparisons on armv7: emulate them below, after Shuffle2301. +-HWY_NEON_DEF_FUNCTION_INT_8_16_32(operator==, vceq, _, HWY_COMPARE) +-HWY_NEON_DEF_FUNCTION_UINT_8_16_32(operator==, vceq, _, HWY_COMPARE) +-#endif ++} // namespace detail + +-// ------------------------------ Strict inequality ++// Not defined on armv7: approximate ++template ++HWY_INLINE Vec128 Sqrt(const Vec128 v) { ++ auto recip = ApproximateReciprocalSqrt(v); + +-// Signed/float < (no unsigned) +-#if HWY_ARCH_ARM_A64 +-HWY_NEON_DEF_FUNCTION_INTS(operator<, vclt, _, HWY_COMPARE) +-#else +-HWY_NEON_DEF_FUNCTION_INT_8_16_32(operator<, vclt, _, HWY_COMPARE) +-#endif +-HWY_NEON_DEF_FUNCTION_ALL_FLOATS(operator<, vclt, _, HWY_COMPARE) ++ recip *= detail::ReciprocalSqrtStep(v * recip, recip); ++ recip *= detail::ReciprocalSqrtStep(v * recip, recip); ++ recip *= detail::ReciprocalSqrtStep(v * recip, recip); + +-// Signed/float > (no unsigned) +-#if HWY_ARCH_ARM_A64 +-HWY_NEON_DEF_FUNCTION_INTS(operator>, vcgt, _, HWY_COMPARE) +-#else +-HWY_NEON_DEF_FUNCTION_INT_8_16_32(operator>, vcgt, _, HWY_COMPARE) ++ const auto root = v * recip; ++ return IfThenZeroElse(v == Zero(Simd()), root); ++} + #endif +-HWY_NEON_DEF_FUNCTION_ALL_FLOATS(operator>, vcgt, _, HWY_COMPARE) +- +-// ------------------------------ Weak inequality +- +-// Float <= >= +-HWY_NEON_DEF_FUNCTION_ALL_FLOATS(operator<=, vcle, _, HWY_COMPARE) +-HWY_NEON_DEF_FUNCTION_ALL_FLOATS(operator>=, vcge, _, HWY_COMPARE) +- +-#undef HWY_NEON_BUILD_TPL_HWY_COMPARE +-#undef HWY_NEON_BUILD_RET_HWY_COMPARE +-#undef HWY_NEON_BUILD_PARAM_HWY_COMPARE +-#undef HWY_NEON_BUILD_ARG_HWY_COMPARE + + // ================================================== LOGICAL + +@@ -1407,13 +1390,16 @@ HWY_NEON_DEF_FUNCTION_ALL_FLOATS(operato + // There is no 64-bit vmvn, so cast instead of using HWY_NEON_DEF_FUNCTION. + template + HWY_INLINE Vec128 Not(const Vec128 v) { +- const Full128 d8; +- return Vec128(vmvnq_u8(BitCast(d8, v).raw)); ++ const Full128 d; ++ const Repartition d8; ++ return BitCast(d, Vec128(vmvnq_u8(BitCast(d8, v).raw))); + } + template + HWY_INLINE Vec128 Not(const Vec128 v) { +- const Repartition> d8; +- return Vec128(vmvn_u8(BitCast(d8, v).raw)); ++ const Simd d; ++ const Repartition d8; ++ using V8 = decltype(Zero(d8)); ++ return BitCast(d, V8(vmvn_u8(BitCast(d8, v).raw))); + } + + // ------------------------------ And +@@ -1513,33 +1499,38 @@ HWY_API Vec128 BroadcastSignBit(co + return ShiftRight(v); + } + +-// ------------------------------ Make mask ++// ================================================== MASK + +-template +-HWY_INLINE Mask128 TestBit(Vec128 v, Vec128 bit) { +- static_assert(!hwy::IsFloat(), "Only integer vectors supported"); +- return (v & bit) == bit; +-} ++// ------------------------------ To/from vector + +-// Mask and Vec are the same (true = FF..FF). ++// Mask and Vec have the same representation (true = FF..FF). + template + HWY_INLINE Mask128 MaskFromVec(const Vec128 v) { +- return Mask128(v.raw); ++ const Simd, N> du; ++ return Mask128(BitCast(du, v).raw); + } + ++// DEPRECATED + template + HWY_INLINE Vec128 VecFromMask(const Mask128 v) { +- return Vec128(v.raw); ++ return BitCast(Simd(), Vec128, N>(v.raw)); + } + + template +-HWY_INLINE Vec128 VecFromMask(Simd /* tag */, +- const Mask128 v) { +- return Vec128(v.raw); ++HWY_INLINE Vec128 VecFromMask(Simd d, const Mask128 v) { ++ return BitCast(d, Vec128, N>(v.raw)); ++} ++ ++// ------------------------------ RebindMask ++ ++template ++HWY_API Mask128 RebindMask(Simd dto, Mask128 m) { ++ static_assert(sizeof(TFrom) == sizeof(TTo), "Must have same size"); ++ return MaskFromVec(BitCast(dto, VecFromMask(Simd(), m))); + } + +-// IfThenElse(mask, yes, no) +-// Returns mask ? b : a. ++// ------------------------------ IfThenElse(mask, yes, no) = mask ? b : a. ++ + #define HWY_NEON_BUILD_TPL_HWY_IF + #define HWY_NEON_BUILD_RET_HWY_IF(type, size) Vec128 + #define HWY_NEON_BUILD_PARAM_HWY_IF(type, size) \ +@@ -1574,7 +1565,6 @@ HWY_INLINE Vec128 ZeroIfNegative(V + return Max(zero, v); + } + +- + // ------------------------------ Mask logical + + template +@@ -1607,30 +1597,183 @@ HWY_API Mask128 Xor(const Mask128< + return MaskFromVec(Xor(VecFromMask(d, a), VecFromMask(d, b))); + } + +-// ------------------------------ Min (IfThenElse, BroadcastSignBit) ++// ================================================== COMPARE + +-namespace detail { ++// Comparisons fill a lane with 1-bits if the condition is true, else 0. ++ ++// ------------------------------ Shuffle2301 (for i64 compares) ++ ++// Swap 32-bit halves in 64-bits ++HWY_INLINE Vec128 Shuffle2301(const Vec128 v) { ++ return Vec128(vrev64_u32(v.raw)); ++} ++HWY_INLINE Vec128 Shuffle2301(const Vec128 v) { ++ return Vec128(vrev64_s32(v.raw)); ++} ++HWY_INLINE Vec128 Shuffle2301(const Vec128 v) { ++ return Vec128(vrev64_f32(v.raw)); ++} ++HWY_INLINE Vec128 Shuffle2301(const Vec128 v) { ++ return Vec128(vrev64q_u32(v.raw)); ++} ++HWY_INLINE Vec128 Shuffle2301(const Vec128 v) { ++ return Vec128(vrev64q_s32(v.raw)); ++} ++HWY_INLINE Vec128 Shuffle2301(const Vec128 v) { ++ return Vec128(vrev64q_f32(v.raw)); ++} ++ ++#define HWY_NEON_BUILD_TPL_HWY_COMPARE ++#define HWY_NEON_BUILD_RET_HWY_COMPARE(type, size) Mask128 ++#define HWY_NEON_BUILD_PARAM_HWY_COMPARE(type, size) \ ++ const Vec128 a, const Vec128 b ++#define HWY_NEON_BUILD_ARG_HWY_COMPARE a.raw, b.raw + ++// ------------------------------ Equality ++HWY_NEON_DEF_FUNCTION_ALL_FLOATS(operator==, vceq, _, HWY_COMPARE) + #if HWY_ARCH_ARM_A64 ++HWY_NEON_DEF_FUNCTION_INTS_UINTS(operator==, vceq, _, HWY_COMPARE) ++#else ++// No 64-bit comparisons on armv7: emulate them below, after Shuffle2301. ++HWY_NEON_DEF_FUNCTION_INT_8_16_32(operator==, vceq, _, HWY_COMPARE) ++HWY_NEON_DEF_FUNCTION_UINT_8_16_32(operator==, vceq, _, HWY_COMPARE) ++#endif + +-HWY_INLINE Vec128 Gt(Vec128 a, Vec128 b) { +- return Vec128(vcgtq_u64(a.raw, b.raw)); ++// ------------------------------ Strict inequality (signed, float) ++#if HWY_ARCH_ARM_A64 ++HWY_NEON_DEF_FUNCTION_INTS(operator<, vclt, _, HWY_COMPARE) ++#else ++HWY_NEON_DEF_FUNCTION_INT_8_16_32(operator<, vclt, _, HWY_COMPARE) ++#endif ++HWY_NEON_DEF_FUNCTION_ALL_FLOATS(operator<, vclt, _, HWY_COMPARE) ++ ++// ------------------------------ Weak inequality (float) ++HWY_NEON_DEF_FUNCTION_ALL_FLOATS(operator<=, vcle, _, HWY_COMPARE) ++ ++#undef HWY_NEON_BUILD_TPL_HWY_COMPARE ++#undef HWY_NEON_BUILD_RET_HWY_COMPARE ++#undef HWY_NEON_BUILD_PARAM_HWY_COMPARE ++#undef HWY_NEON_BUILD_ARG_HWY_COMPARE ++ ++// ------------------------------ ARMv7 i64 compare (Shuffle2301, Eq) ++ ++#if HWY_ARCH_ARM_V7 ++ ++template ++HWY_INLINE Mask128 operator==(const Vec128 a, ++ const Vec128 b) { ++ const Simd d32; ++ const Simd d64; ++ const auto cmp32 = VecFromMask(d32, Eq(BitCast(d32, a), BitCast(d32, b))); ++ const auto cmp64 = cmp32 & Shuffle2301(cmp32); ++ return MaskFromVec(BitCast(d64, cmp64)); + } +-HWY_INLINE Vec128 Gt(Vec128 a, +- Vec128 b) { +- return Vec128(vcgt_u64(a.raw, b.raw)); ++ ++template ++HWY_INLINE Mask128 operator==(const Vec128 a, ++ const Vec128 b) { ++ const Simd d32; ++ const Simd d64; ++ const auto cmp32 = VecFromMask(d32, Eq(BitCast(d32, a), BitCast(d32, b))); ++ const auto cmp64 = cmp32 & Shuffle2301(cmp32); ++ return MaskFromVec(BitCast(d64, cmp64)); + } + +-HWY_INLINE Vec128 Gt(Vec128 a, Vec128 b) { +- return Vec128(vcgtq_s64(a.raw, b.raw)); ++HWY_INLINE Mask128 operator<(const Vec128 a, ++ const Vec128 b) { ++ const int64x2_t sub = vqsubq_s64(a.raw, b.raw); ++ return MaskFromVec(BroadcastSignBit(Vec128(sub))); + } +-HWY_INLINE Vec128 Gt(Vec128 a, Vec128 b) { +- return Vec128(vcgt_s64(a.raw, b.raw)); ++HWY_INLINE Mask128 operator<(const Vec128 a, ++ const Vec128 b) { ++ const int64x1_t sub = vqsub_s64(a.raw, b.raw); ++ return MaskFromVec(BroadcastSignBit(Vec128(sub))); + } + + #endif + +-} // namespace detail ++// ------------------------------ Reversed comparisons ++ ++template ++HWY_API Mask128 operator>(Vec128 a, Vec128 b) { ++ return operator<(b, a); ++} ++template ++HWY_API Mask128 operator>=(Vec128 a, Vec128 b) { ++ return operator<=(b, a); ++} ++ ++// ------------------------------ FirstN (Iota, Lt) ++ ++template ++HWY_API Mask128 FirstN(const Simd d, size_t num) { ++ const RebindToSigned di; // Signed comparisons are cheaper. ++ return RebindMask(d, Iota(di, 0) < Set(di, static_cast>(num))); ++} ++ ++// ------------------------------ TestBit (Eq) ++ ++#define HWY_NEON_BUILD_TPL_HWY_TESTBIT ++#define HWY_NEON_BUILD_RET_HWY_TESTBIT(type, size) Mask128 ++#define HWY_NEON_BUILD_PARAM_HWY_TESTBIT(type, size) \ ++ Vec128 v, Vec128 bit ++#define HWY_NEON_BUILD_ARG_HWY_TESTBIT v.raw, bit.raw ++ ++#if HWY_ARCH_ARM_A64 ++HWY_NEON_DEF_FUNCTION_INTS_UINTS(TestBit, vtst, _, HWY_TESTBIT) ++#else ++// No 64-bit versions on armv7 ++HWY_NEON_DEF_FUNCTION_UINT_8_16_32(TestBit, vtst, _, HWY_TESTBIT) ++HWY_NEON_DEF_FUNCTION_INT_8_16_32(TestBit, vtst, _, HWY_TESTBIT) ++ ++template ++HWY_INLINE Mask128 TestBit(Vec128 v, ++ Vec128 bit) { ++ return (v & bit) == bit; ++} ++template ++HWY_INLINE Mask128 TestBit(Vec128 v, ++ Vec128 bit) { ++ return (v & bit) == bit; ++} ++ ++#endif ++#undef HWY_NEON_BUILD_TPL_HWY_TESTBIT ++#undef HWY_NEON_BUILD_RET_HWY_TESTBIT ++#undef HWY_NEON_BUILD_PARAM_HWY_TESTBIT ++#undef HWY_NEON_BUILD_ARG_HWY_TESTBIT ++ ++// ------------------------------ Abs i64 (IfThenElse, BroadcastSignBit) ++HWY_INLINE Vec128 Abs(const Vec128 v) { ++#if HWY_ARCH_ARM_A64 ++ return Vec128(vabsq_s64(v.raw)); ++#else ++ const auto zero = Zero(Full128()); ++ return IfThenElse(MaskFromVec(BroadcastSignBit(v)), zero - v, v); ++#endif ++} ++HWY_INLINE Vec128 Abs(const Vec128 v) { ++#if HWY_ARCH_ARM_A64 ++ return Vec128(vabs_s64(v.raw)); ++#else ++ const auto zero = Zero(Simd()); ++ return IfThenElse(MaskFromVec(BroadcastSignBit(v)), zero - v, v); ++#endif ++} ++ ++// ------------------------------ Min (IfThenElse, BroadcastSignBit) ++ ++#if HWY_ARCH_ARM_A64 ++ ++HWY_INLINE Mask128 operator<(Vec128 a, Vec128 b) { ++ return Mask128(vcltq_u64(a.raw, b.raw)); ++} ++HWY_INLINE Mask128 operator<(Vec128 a, ++ Vec128 b) { ++ return Mask128(vclt_u64(a.raw, b.raw)); ++} ++ ++#endif + + // Unsigned + HWY_NEON_DEF_FUNCTION_UINT_8_16_32(Min, vmin, _, 2) +@@ -1639,7 +1782,7 @@ template + HWY_INLINE Vec128 Min(const Vec128 a, + const Vec128 b) { + #if HWY_ARCH_ARM_A64 +- return IfThenElse(MaskFromVec(detail::Gt(a, b)), b, a); ++ return IfThenElse(b < a, b, a); + #else + const Simd du; + const Simd di; +@@ -1654,7 +1797,7 @@ template + HWY_INLINE Vec128 Min(const Vec128 a, + const Vec128 b) { + #if HWY_ARCH_ARM_A64 +- return IfThenElse(MaskFromVec(detail::Gt(a, b)), b, a); ++ return IfThenElse(b < a, b, a); + #else + const Vec128 sign = detail::SaturatedSub(a, b); + return IfThenElse(MaskFromVec(BroadcastSignBit(sign)), a, b); +@@ -1677,7 +1820,7 @@ template + HWY_INLINE Vec128 Max(const Vec128 a, + const Vec128 b) { + #if HWY_ARCH_ARM_A64 +- return IfThenElse(MaskFromVec(detail::Gt(a, b)), a, b); ++ return IfThenElse(b < a, a, b); + #else + const Simd du; + const Simd di; +@@ -1692,7 +1835,7 @@ template + HWY_INLINE Vec128 Max(const Vec128 a, + const Vec128 b) { + #if HWY_ARCH_ARM_A64 +- return IfThenElse(MaskFromVec(detail::Gt(a, b)), a, b); ++ return IfThenElse(b < a, a, b); + #else + const Vec128 sign = detail::SaturatedSub(a, b); + return IfThenElse(MaskFromVec(BroadcastSignBit(sign)), b, a); +@@ -1805,73 +1948,72 @@ HWY_INLINE Vec128 LoadU(Simd< + // we don't actually care what is in it, and we don't want + // to introduce extra overhead by initializing it to something. + +-HWY_INLINE Vec128 LoadU(Simd d, ++HWY_INLINE Vec128 LoadU(Simd /*tag*/, + const uint8_t* HWY_RESTRICT p) { +- uint32x2_t a = Undefined(d).raw; ++ uint32x2_t a = Undefined(Simd()).raw; + uint32x2_t b = vld1_lane_u32(reinterpret_cast(p), a, 0); + return Vec128(vreinterpret_u8_u32(b)); + } +-HWY_INLINE Vec128 LoadU(Simd d, ++HWY_INLINE Vec128 LoadU(Simd /*tag*/, + const uint16_t* HWY_RESTRICT p) { +- uint32x2_t a = Undefined(d).raw; ++ uint32x2_t a = Undefined(Simd()).raw; + uint32x2_t b = vld1_lane_u32(reinterpret_cast(p), a, 0); + return Vec128(vreinterpret_u16_u32(b)); + } +-HWY_INLINE Vec128 LoadU(Simd d, ++HWY_INLINE Vec128 LoadU(Simd /*tag*/, + const uint32_t* HWY_RESTRICT p) { +- uint32x2_t a = Undefined(d).raw; ++ uint32x2_t a = Undefined(Simd()).raw; + uint32x2_t b = vld1_lane_u32(p, a, 0); + return Vec128(b); + } +-HWY_INLINE Vec128 LoadU(Simd d, ++HWY_INLINE Vec128 LoadU(Simd /*tag*/, + const int8_t* HWY_RESTRICT p) { +- int32x2_t a = Undefined(d).raw; ++ int32x2_t a = Undefined(Simd()).raw; + int32x2_t b = vld1_lane_s32(reinterpret_cast(p), a, 0); + return Vec128(vreinterpret_s8_s32(b)); + } +-HWY_INLINE Vec128 LoadU(Simd d, ++HWY_INLINE Vec128 LoadU(Simd /*tag*/, + const int16_t* HWY_RESTRICT p) { +- int32x2_t a = Undefined(d).raw; ++ int32x2_t a = Undefined(Simd()).raw; + int32x2_t b = vld1_lane_s32(reinterpret_cast(p), a, 0); + return Vec128(vreinterpret_s16_s32(b)); + } +-HWY_INLINE Vec128 LoadU(Simd d, ++HWY_INLINE Vec128 LoadU(Simd /*tag*/, + const int32_t* HWY_RESTRICT p) { +- int32x2_t a = Undefined(d).raw; ++ int32x2_t a = Undefined(Simd()).raw; + int32x2_t b = vld1_lane_s32(p, a, 0); + return Vec128(b); + } +-HWY_INLINE Vec128 LoadU(Simd d, ++HWY_INLINE Vec128 LoadU(Simd /*tag*/, + const float* HWY_RESTRICT p) { +- float32x2_t a = Undefined(d).raw; ++ float32x2_t a = Undefined(Simd()).raw; + float32x2_t b = vld1_lane_f32(p, a, 0); + return Vec128(b); + } + + // ------------------------------ Load 16 + +-HWY_INLINE Vec128 LoadU(Simd d, ++HWY_INLINE Vec128 LoadU(Simd /*tag*/, + const uint8_t* HWY_RESTRICT p) { +- uint16x4_t a = Undefined(d).raw; ++ uint16x4_t a = Undefined(Simd()).raw; + uint16x4_t b = vld1_lane_u16(reinterpret_cast(p), a, 0); + return Vec128(vreinterpret_u8_u16(b)); + } +-HWY_INLINE Vec128 LoadU(Simd d, ++HWY_INLINE Vec128 LoadU(Simd /*tag*/, + const uint16_t* HWY_RESTRICT p) { +- uint16x4_t a = Undefined(d).raw; ++ uint16x4_t a = Undefined(Simd()).raw; + uint16x4_t b = vld1_lane_u16(p, a, 0); + return Vec128(b); + } +- +-HWY_INLINE Vec128 LoadU(Simd d, ++HWY_INLINE Vec128 LoadU(Simd /*tag*/, + const int8_t* HWY_RESTRICT p) { +- int16x4_t a = Undefined(d).raw; ++ int16x4_t a = Undefined(Simd()).raw; + int16x4_t b = vld1_lane_s16(reinterpret_cast(p), a, 0); + return Vec128(vreinterpret_s8_s16(b)); + } +-HWY_INLINE Vec128 LoadU(Simd d, ++HWY_INLINE Vec128 LoadU(Simd /*tag*/, + const int16_t* HWY_RESTRICT p) { +- int16x4_t a = Undefined(d).raw; ++ int16x4_t a = Undefined(Simd()).raw; + int16x4_t b = vld1_lane_s16(p, a, 0); + return Vec128(b); + } +@@ -2009,12 +2151,12 @@ HWY_INLINE void StoreU(const Vec128 v, Simd, + uint8_t* HWY_RESTRICT p) { + uint32x2_t a = vreinterpret_u32_u8(v.raw); +- vst1_lane_u32(p, a, 0); ++ vst1_lane_u32(reinterpret_cast(p), a, 0); + } + HWY_INLINE void StoreU(const Vec128 v, Simd, + uint16_t* HWY_RESTRICT p) { + uint32x2_t a = vreinterpret_u32_u16(v.raw); +- vst1_lane_u32(p, a, 0); ++ vst1_lane_u32(reinterpret_cast(p), a, 0); + } + HWY_INLINE void StoreU(const Vec128 v, Simd, + uint32_t* HWY_RESTRICT p) { +@@ -2023,12 +2165,12 @@ HWY_INLINE void StoreU(const Vec128 v, Simd, + int8_t* HWY_RESTRICT p) { + int32x2_t a = vreinterpret_s32_s8(v.raw); +- vst1_lane_s32(p, a, 0); ++ vst1_lane_s32(reinterpret_cast(p), a, 0); + } + HWY_INLINE void StoreU(const Vec128 v, Simd, + int16_t* HWY_RESTRICT p) { + int32x2_t a = vreinterpret_s32_s16(v.raw); +- vst1_lane_s32(p, a, 0); ++ vst1_lane_s32(reinterpret_cast(p), a, 0); + } + HWY_INLINE void StoreU(const Vec128 v, Simd, + int32_t* HWY_RESTRICT p) { +@@ -2044,7 +2186,7 @@ HWY_INLINE void StoreU(const Vec128 v, Simd, + uint8_t* HWY_RESTRICT p) { + uint16x4_t a = vreinterpret_u16_u8(v.raw); +- vst1_lane_u16(p, a, 0); ++ vst1_lane_u16(reinterpret_cast(p), a, 0); + } + HWY_INLINE void StoreU(const Vec128 v, Simd, + uint16_t* HWY_RESTRICT p) { +@@ -2053,7 +2195,7 @@ HWY_INLINE void StoreU(const Vec128 v, Simd, + int8_t* HWY_RESTRICT p) { + int16x4_t a = vreinterpret_s16_s8(v.raw); +- vst1_lane_s16(p, a, 0); ++ vst1_lane_s16(reinterpret_cast(p), a, 0); + } + HWY_INLINE void StoreU(const Vec128 v, Simd, + int16_t* HWY_RESTRICT p) { +@@ -2118,18 +2260,18 @@ HWY_INLINE Vec128 PromoteTo(Fu + const Vec128 v) { + return Vec128(vmovl_u32(v.raw)); + } +-HWY_INLINE Vec128 PromoteTo(Full128 /* tag */, ++HWY_INLINE Vec128 PromoteTo(Full128 d, + const Vec128 v) { +- return Vec128(vmovl_u8(v.raw)); ++ return BitCast(d, Vec128(vmovl_u8(v.raw))); + } +-HWY_INLINE Vec128 PromoteTo(Full128 /* tag */, ++HWY_INLINE Vec128 PromoteTo(Full128 d, + const Vec128 v) { + uint16x8_t a = vmovl_u8(v.raw); +- return Vec128(vreinterpretq_s32_u16(vmovl_u16(vget_low_u16(a)))); ++ return BitCast(d, Vec128(vmovl_u16(vget_low_u16(a)))); + } +-HWY_INLINE Vec128 PromoteTo(Full128 /* tag */, ++HWY_INLINE Vec128 PromoteTo(Full128 d, + const Vec128 v) { +- return Vec128(vmovl_u16(v.raw)); ++ return BitCast(d, Vec128(vmovl_u16(v.raw))); + } + + // Unsigned: zero-extend to half vector. +@@ -2155,9 +2297,9 @@ HWY_INLINE Vec128 PromoteTo + return Vec128(vget_low_u64(vmovl_u32(v.raw))); + } + template +-HWY_INLINE Vec128 PromoteTo(Simd /* tag */, ++HWY_INLINE Vec128 PromoteTo(Simd d, + const Vec128 v) { +- return Vec128(vget_low_s16(vmovl_u8(v.raw))); ++ return BitCast(d, Vec128(vget_low_u16(vmovl_u8(v.raw)))); + } + template + HWY_INLINE Vec128 PromoteTo(Simd /* tag */, +@@ -2220,12 +2362,14 @@ HWY_INLINE Vec128 PromoteTo( + + HWY_INLINE Vec128 PromoteTo(Full128 /* tag */, + const Vec128 v) { +- return Vec128(vcvt_f32_f16(vreinterpret_f16_u16(v.raw))); ++ const float32x4_t f32 = vcvt_f32_f16(vreinterpret_f16_u16(v.raw)); ++ return Vec128(f32); + } + template + HWY_INLINE Vec128 PromoteTo(Simd /* tag */, + const Vec128 v) { +- return Vec128(vget_low_f32(vcvt_f32_f16(v.raw))); ++ const float32x4_t f32 = vcvt_f32_f16(vreinterpret_f16_u16(v.raw)); ++ return Vec128(vget_low_f32(f32)); + } + + #else +@@ -2353,7 +2497,8 @@ HWY_INLINE Vec128 DemoteTo + template + HWY_INLINE Vec128 DemoteTo(Simd /* tag */, + const Vec128 v) { +- return Vec128{vcvt_f16_f32(vcombine_f32(v.raw, v.raw))}; ++ const float16x4_t f16 = vcvt_f16_f32(vcombine_f32(v.raw, v.raw)); ++ return Vec128(vreinterpret_u16_f16(f16)); + } + + #else +@@ -2965,33 +3110,58 @@ HWY_INLINE Vec128 TableLookupBytes + BitCast(d8, from).raw))); + } + +-// ------------------------------ Hard-coded shuffles ++// ------------------------------ TableLookupLanes + +-// Notation: let Vec128 have lanes 3,2,1,0 (0 is least-significant). +-// Shuffle0321 rotates one lane to the right (the previous least-significant +-// lane is now most-significant). These could also be implemented via +-// CombineShiftRightBytes but the shuffle_abcd notation is more convenient. ++// Returned by SetTableIndices for use by TableLookupLanes. ++template ++struct Indices128 { ++ typename detail::Raw128::type raw; ++}; + +-// Swap 32-bit halves in 64-bits +-HWY_INLINE Vec128 Shuffle2301(const Vec128 v) { +- return Vec128(vrev64_u32(v.raw)); +-} +-HWY_INLINE Vec128 Shuffle2301(const Vec128 v) { +- return Vec128(vrev64_s32(v.raw)); +-} +-HWY_INLINE Vec128 Shuffle2301(const Vec128 v) { +- return Vec128(vrev64_f32(v.raw)); ++template ++HWY_INLINE Indices128 SetTableIndices(Simd d, const int32_t* idx) { ++#if !defined(NDEBUG) || defined(ADDRESS_SANITIZER) ++ for (size_t i = 0; i < N; ++i) { ++ HWY_DASSERT(0 <= idx[i] && idx[i] < static_cast(N)); ++ } ++#endif ++ ++ const Repartition d8; ++ alignas(16) uint8_t control[16] = {0}; ++ for (size_t idx_lane = 0; idx_lane < N; ++idx_lane) { ++ for (size_t idx_byte = 0; idx_byte < sizeof(T); ++idx_byte) { ++ control[idx_lane * sizeof(T) + idx_byte] = ++ static_cast(idx[idx_lane] * sizeof(T) + idx_byte); ++ } ++ } ++ return Indices128{BitCast(d, Load(d8, control)).raw}; + } +-HWY_INLINE Vec128 Shuffle2301(const Vec128 v) { +- return Vec128(vrev64q_u32(v.raw)); ++ ++template ++HWY_INLINE Vec128 TableLookupLanes( ++ const Vec128 v, const Indices128 idx) { ++ return TableLookupBytes(v, Vec128{idx.raw}); + } +-HWY_INLINE Vec128 Shuffle2301(const Vec128 v) { +- return Vec128(vrev64q_s32(v.raw)); ++template ++HWY_INLINE Vec128 TableLookupLanes( ++ const Vec128 v, const Indices128 idx) { ++ return TableLookupBytes(v, Vec128{idx.raw}); + } +-HWY_INLINE Vec128 Shuffle2301(const Vec128 v) { +- return Vec128(vrev64q_f32(v.raw)); ++template ++HWY_INLINE Vec128 TableLookupLanes(const Vec128 v, ++ const Indices128 idx) { ++ const Simd di; ++ const auto idx_i = BitCast(di, Vec128{idx.raw}); ++ return BitCast(Simd(), TableLookupBytes(BitCast(di, v), idx_i)); + } + ++// ------------------------------ Other shuffles (TableLookupBytes) ++ ++// Notation: let Vec128 have lanes 3,2,1,0 (0 is least-significant). ++// Shuffle0321 rotates one lane to the right (the previous least-significant ++// lane is now most-significant). These could also be implemented via ++// CombineShiftRightBytes but the shuffle_abcd notation is more convenient. ++ + // Swap 64-bit halves + template + HWY_INLINE Vec128 Shuffle1032(const Vec128 v) { +@@ -3029,49 +3199,6 @@ HWY_INLINE Vec128 Shuffle0123(const V + return TableLookupBytes(v, BitCast(d, Load(d8, bytes))); + } + +-// ------------------------------ TableLookupLanes +- +-// Returned by SetTableIndices for use by TableLookupLanes. +-template +-struct Indices128 { +- typename Raw128::type raw; +-}; +- +-template +-HWY_INLINE Indices128 SetTableIndices(const Full128, const int32_t* idx) { +-#if !defined(NDEBUG) || defined(ADDRESS_SANITIZER) +- const size_t N = 16 / sizeof(T); +- for (size_t i = 0; i < N; ++i) { +- HWY_DASSERT(0 <= idx[i] && idx[i] < static_cast(N)); +- } +-#endif +- +- const Full128 d8; +- alignas(16) uint8_t control[16]; +- for (size_t idx_byte = 0; idx_byte < 16; ++idx_byte) { +- const size_t idx_lane = idx_byte / sizeof(T); +- const size_t mod = idx_byte % sizeof(T); +- control[idx_byte] = idx[idx_lane] * sizeof(T) + mod; +- } +- return Indices128{BitCast(Full128(), Load(d8, control)).raw}; +-} +- +-HWY_INLINE Vec128 TableLookupLanes(const Vec128 v, +- const Indices128 idx) { +- return TableLookupBytes(v, Vec128(idx.raw)); +-} +-HWY_INLINE Vec128 TableLookupLanes(const Vec128 v, +- const Indices128 idx) { +- return TableLookupBytes(v, Vec128(idx.raw)); +-} +-HWY_INLINE Vec128 TableLookupLanes(const Vec128 v, +- const Indices128 idx) { +- const Full128 di; +- const Full128 df; +- return BitCast(df, +- TableLookupBytes(BitCast(di, v), Vec128(idx.raw))); +-} +- + // ------------------------------ Interleave lanes + + // Interleaves lanes from halves of the 128-bit blocks of "a" (which provides +@@ -3334,16 +3461,6 @@ HWY_INLINE Vec128 OddEven(const Vec12 + + // ================================================== MISC + +-// Returns a vector with lane i=[0, N) set to "first" + i. +-template +-Vec128 Iota(const Simd d, const T2 first) { +- HWY_ALIGN T lanes[16 / sizeof(T)]; +- for (size_t i = 0; i < 16 / sizeof(T); ++i) { +- lanes[i] = static_cast(first + static_cast(i)); +- } +- return Load(d, lanes); +-} +- + // ------------------------------ Scatter (Store) + + template +@@ -3413,52 +3530,44 @@ HWY_API Vec128 GatherIndex(const S + return Load(d, lanes); + } + +-// ------------------------------ ARMv7 int64 comparisons (requires Shuffle2301) ++// ------------------------------ Reductions + +-#if HWY_ARCH_ARM_V7 ++namespace detail { + +-template +-HWY_INLINE Mask128 operator==(const Vec128 a, +- const Vec128 b) { +- const Simd d32; +- const Simd d64; +- const auto cmp32 = VecFromMask(d32, BitCast(d32, a) == BitCast(d32, b)); +- const auto cmp64 = cmp32 & Shuffle2301(cmp32); +- return MaskFromVec(BitCast(d64, cmp64)); ++// N=1 for any T: no-op ++template ++HWY_API Vec128 SumOfLanes(const Vec128 v) { ++ return v; + } +- +-template +-HWY_INLINE Mask128 operator==(const Vec128 a, +- const Vec128 b) { +- const Simd d32; +- const Simd d64; +- const auto cmp32 = VecFromMask(d32, BitCast(d32, a) == BitCast(d32, b)); +- const auto cmp64 = cmp32 & Shuffle2301(cmp32); +- return MaskFromVec(BitCast(d64, cmp64)); ++template ++HWY_API Vec128 MinOfLanes(hwy::SizeTag /* tag */, ++ const Vec128 v) { ++ return v; ++} ++template ++HWY_API Vec128 MaxOfLanes(hwy::SizeTag /* tag */, ++ const Vec128 v) { ++ return v; + } + +-HWY_INLINE Mask128 operator<(const Vec128 a, +- const Vec128 b) { +- const int64x2_t sub = vqsubq_s64(a.raw, b.raw); +- return MaskFromVec(BroadcastSignBit(Vec128(sub))); ++// u32/i32/f32: N=2 ++template ++HWY_API Vec128 SumOfLanes(const Vec128 v10) { ++ return v10 + Shuffle2301(v10); + } +-HWY_INLINE Mask128 operator<(const Vec128 a, +- const Vec128 b) { +- const int64x1_t sub = vqsub_s64(a.raw, b.raw); +- return MaskFromVec(BroadcastSignBit(Vec128(sub))); ++template ++HWY_API Vec128 MinOfLanes(hwy::SizeTag<4> /* tag */, ++ const Vec128 v10) { ++ return Min(v10, Shuffle2301(v10)); + } +- +-template +-HWY_INLINE Mask128 operator>(const Vec128 a, +- const Vec128 b) { +- return b < a; ++template ++HWY_API Vec128 MaxOfLanes(hwy::SizeTag<4> /* tag */, ++ const Vec128 v10) { ++ return Max(v10, Shuffle2301(v10)); + } +-#endif +- +-// ------------------------------ Reductions + ++// full vectors + #if HWY_ARCH_ARM_A64 +-// Supported for 32b and 64b vector types. Returns the sum in each lane. + HWY_INLINE Vec128 SumOfLanes(const Vec128 v) { + return Vec128(vdupq_n_u32(vaddvq_u32(v.raw))); + } +@@ -3505,20 +3614,15 @@ HWY_INLINE Vec128 SumOfLanes(co + } + #endif + +-namespace detail { +- +-// For u32/i32/f32. +-template +-HWY_API Vec128 MinOfLanes(hwy::SizeTag<4> /* tag */, +- const Vec128 v3210) { ++template ++HWY_API Vec128 MinOfLanes(hwy::SizeTag<4> /* tag */, const Vec128 v3210) { + const Vec128 v1032 = Shuffle1032(v3210); + const Vec128 v31_20_31_20 = Min(v3210, v1032); + const Vec128 v20_31_20_31 = Shuffle0321(v31_20_31_20); + return Min(v20_31_20_31, v31_20_31_20); + } +-template +-HWY_API Vec128 MaxOfLanes(hwy::SizeTag<4> /* tag */, +- const Vec128 v3210) { ++template ++HWY_API Vec128 MaxOfLanes(hwy::SizeTag<4> /* tag */, const Vec128 v3210) { + const Vec128 v1032 = Shuffle1032(v3210); + const Vec128 v31_20_31_20 = Max(v3210, v1032); + const Vec128 v20_31_20_31 = Shuffle0321(v31_20_31_20); +@@ -3526,15 +3630,13 @@ HWY_API Vec128 MaxOfLanes(hwy::Siz + } + + // For u64/i64[/f64]. +-template +-HWY_API Vec128 MinOfLanes(hwy::SizeTag<8> /* tag */, +- const Vec128 v10) { ++template ++HWY_API Vec128 MinOfLanes(hwy::SizeTag<8> /* tag */, const Vec128 v10) { + const Vec128 v01 = Shuffle01(v10); + return Min(v10, v01); + } +-template +-HWY_API Vec128 MaxOfLanes(hwy::SizeTag<8> /* tag */, +- const Vec128 v10) { ++template ++HWY_API Vec128 MaxOfLanes(hwy::SizeTag<8> /* tag */, const Vec128 v10) { + const Vec128 v01 = Shuffle01(v10); + return Max(v10, v01); + } +@@ -3542,6 +3644,10 @@ HWY_API Vec128 MaxOfLanes(hwy::Siz + } // namespace detail + + template ++HWY_API Vec128 SumOfLanes(const Vec128 v) { ++ return detail::SumOfLanes(v); ++} ++template + HWY_API Vec128 MinOfLanes(const Vec128 v) { + return detail::MinOfLanes(hwy::SizeTag(), v); + } +@@ -3569,13 +3675,13 @@ HWY_INLINE uint64_t BitsFromMask(hwy::Si + const uint8x8_t x2 = vget_low_u8(vpaddq_u8(values.raw, values.raw)); + const uint8x8_t x4 = vpadd_u8(x2, x2); + const uint8x8_t x8 = vpadd_u8(x4, x4); +- return vreinterpret_u16_u8(x8)[0]; ++ return vget_lane_u64(vreinterpret_u64_u8(x8), 0); + #else + // Don't have vpaddq, so keep doubling lane size. + const uint16x8_t x2 = vpaddlq_u8(values.raw); + const uint32x4_t x4 = vpaddlq_u16(x2); + const uint64x2_t x8 = vpaddlq_u32(x4); +- return (uint64_t(x8[1]) << 8) | x8[0]; ++ return (vgetq_lane_u64(x8, 1) << 8) | vgetq_lane_u64(x8, 0); + #endif + } + +@@ -3725,7 +3831,7 @@ HWY_INLINE size_t CountTrue(hwy::SizeTag + const int16x8_t x2 = vpaddlq_s8(ones); + const int32x4_t x4 = vpaddlq_s16(x2); + const int64x2_t x8 = vpaddlq_s32(x4); +- return x8[0] + x8[1]; ++ return vgetq_lane_s64(x8, 0) + vgetq_lane_s64(x8, 1); + #endif + } + template +@@ -3739,7 +3845,7 @@ HWY_INLINE size_t CountTrue(hwy::SizeTag + #else + const int32x4_t x2 = vpaddlq_s16(ones); + const int64x2_t x4 = vpaddlq_s32(x2); +- return x4[0] + x4[1]; ++ return vgetq_lane_s64(x4, 0) + vgetq_lane_s64(x4, 1); + #endif + } + +@@ -3753,7 +3859,7 @@ HWY_INLINE size_t CountTrue(hwy::SizeTag + return vaddvq_s32(ones); + #else + const int64x2_t x2 = vpaddlq_s32(ones); +- return x2[0] + x2[1]; ++ return vgetq_lane_s64(x2, 0) + vgetq_lane_s64(x2, 1); + #endif + } + +@@ -3765,10 +3871,10 @@ HWY_INLINE size_t CountTrue(hwy::SizeTag + vnegq_s64(BitCast(di, VecFromMask(Full128(), mask)).raw); + return vaddvq_s64(ones); + #else +- const Full128 di; +- const int64x2_t ones = +- vshrq_n_u64(BitCast(di, VecFromMask(Full128(), mask)).raw, 63); +- return ones[0] + ones[1]; ++ const Full128 du; ++ const auto mask_u = VecFromMask(du, RebindMask(du, mask)); ++ const uint64x2_t ones = vshrq_n_u64(mask_u.raw, 63); ++ return vgetq_lane_u64(ones, 0) + vgetq_lane_u64(ones, 1); + #endif + } + +@@ -3798,11 +3904,13 @@ HWY_INLINE size_t StoreMaskBits(const Ma + template + HWY_INLINE bool AllFalse(const Mask128 m) { + #if HWY_ARCH_ARM_A64 +- return (vmaxvq_u32(m.raw) == 0); ++ const Full128 d32; ++ const auto m32 = MaskFromVec(BitCast(d32, VecFromMask(Full128(), m))); ++ return (vmaxvq_u32(m32.raw) == 0); + #else + const auto v64 = BitCast(Full128(), VecFromMask(Full128(), m)); + uint32x2_t a = vqmovn_u64(v64.raw); +- return vreinterpret_u64_u32(a)[0] == 0; ++ return vget_lane_u64(vreinterpret_u64_u32(a), 0) == 0; + #endif + } + +@@ -4178,6 +4286,7 @@ HWY_API auto Le(V a, V b) -> decltype(a + return a <= b; + } + ++namespace detail { // for code folding + #if HWY_ARCH_ARM_V7 + #undef vuzp1_s8 + #undef vuzp1_u8 +@@ -4265,6 +4374,7 @@ HWY_API auto Le(V a, V b) -> decltype(a + #undef HWY_NEON_DEF_FUNCTION_UINT_8_16_32 + #undef HWY_NEON_DEF_FUNCTION_UINTS + #undef HWY_NEON_EVAL ++} // namespace detail + + // NOLINTNEXTLINE(google-readability-namespace-comments) + } // namespace HWY_NAMESPACE +diff -up chromium-92.0.4515.107/third_party/highway/src/hwy/ops/rvv-inl.h.update-highway-0.12.2 chromium-92.0.4515.107/third_party/highway/src/hwy/ops/rvv-inl.h +--- chromium-92.0.4515.107/third_party/highway/src/hwy/ops/rvv-inl.h.update-highway-0.12.2 2021-07-19 14:47:23.000000000 -0400 ++++ chromium-92.0.4515.107/third_party/highway/src/hwy/ops/rvv-inl.h 2021-07-26 17:10:30.290171587 -0400 +@@ -39,6 +39,11 @@ using TFromV = TFromD>; + hwy::EnableIf>() && !IsFloat>()>* = nullptr + #define HWY_IF_FLOAT_V(V) hwy::EnableIf>()>* = nullptr + ++// kShift = log2 of multiplier: 0 for m1, 1 for m2, -2 for mf4 ++template ++using Full = Simd> (-kShift)) ++ : (HWY_LANES(T) << kShift)>; ++ + // ================================================== MACROS + + // Generate specializations and function definitions using X macros. Although +@@ -58,29 +63,30 @@ namespace detail { // for code folding + + // For given SEW, iterate over all LMUL. Precompute SEW/LMUL => MLEN because the + // preprocessor cannot easily do it. +-#define HWY_RVV_FOREACH_08(X_MACRO, BASE, CHAR, NAME, OP) \ +- X_MACRO(BASE, CHAR, 8, 1, 8, NAME, OP) \ +- X_MACRO(BASE, CHAR, 8, 2, 4, NAME, OP) \ +- X_MACRO(BASE, CHAR, 8, 4, 2, NAME, OP) \ +- X_MACRO(BASE, CHAR, 8, 8, 1, NAME, OP) +- +-#define HWY_RVV_FOREACH_16(X_MACRO, BASE, CHAR, NAME, OP) \ +- X_MACRO(BASE, CHAR, 16, 1, 16, NAME, OP) \ +- X_MACRO(BASE, CHAR, 16, 2, 8, NAME, OP) \ +- X_MACRO(BASE, CHAR, 16, 4, 4, NAME, OP) \ +- X_MACRO(BASE, CHAR, 16, 8, 2, NAME, OP) +- +-#define HWY_RVV_FOREACH_32(X_MACRO, BASE, CHAR, NAME, OP) \ +- X_MACRO(BASE, CHAR, 32, 1, 32, NAME, OP) \ +- X_MACRO(BASE, CHAR, 32, 2, 16, NAME, OP) \ +- X_MACRO(BASE, CHAR, 32, 4, 8, NAME, OP) \ +- X_MACRO(BASE, CHAR, 32, 8, 4, NAME, OP) +- +-#define HWY_RVV_FOREACH_64(X_MACRO, BASE, CHAR, NAME, OP) \ +- X_MACRO(BASE, CHAR, 64, 1, 64, NAME, OP) \ +- X_MACRO(BASE, CHAR, 64, 2, 32, NAME, OP) \ +- X_MACRO(BASE, CHAR, 64, 4, 16, NAME, OP) \ +- X_MACRO(BASE, CHAR, 64, 8, 8, NAME, OP) ++// TODO(janwas): GCC does not yet support fractional LMUL ++#define HWY_RVV_FOREACH_08(X_MACRO, BASE, CHAR, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 8, m1, /*kShift=*/0, /*MLEN=*/8, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 8, m2, /*kShift=*/1, /*MLEN=*/4, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 8, m4, /*kShift=*/2, /*MLEN=*/2, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 8, m8, /*kShift=*/3, /*MLEN=*/1, NAME, OP) ++ ++#define HWY_RVV_FOREACH_16(X_MACRO, BASE, CHAR, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 16, m1, /*kShift=*/0, /*MLEN=*/16, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 16, m2, /*kShift=*/1, /*MLEN=*/8, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 16, m4, /*kShift=*/2, /*MLEN=*/4, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 16, m8, /*kShift=*/3, /*MLEN=*/2, NAME, OP) ++ ++#define HWY_RVV_FOREACH_32(X_MACRO, BASE, CHAR, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 32, m1, /*kShift=*/0, /*MLEN=*/32, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 32, m2, /*kShift=*/1, /*MLEN=*/16, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 32, m4, /*kShift=*/2, /*MLEN=*/8, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 32, m8, /*kShift=*/3, /*MLEN=*/4, NAME, OP) ++ ++#define HWY_RVV_FOREACH_64(X_MACRO, BASE, CHAR, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 64, m1, /*kShift=*/0, /*MLEN=*/64, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 64, m2, /*kShift=*/1, /*MLEN=*/32, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 64, m4, /*kShift=*/2, /*MLEN=*/16, NAME, OP) \ ++ X_MACRO(BASE, CHAR, 64, m8, /*kShift=*/3, /*MLEN=*/8, NAME, OP) + + // SEW for unsigned: + #define HWY_RVV_FOREACH_U08(X_MACRO, NAME, OP) \ +@@ -153,63 +159,61 @@ namespace detail { // for code folding + + // Assemble types for use in x-macros + #define HWY_RVV_T(BASE, SEW) BASE##SEW##_t +-#define HWY_RVV_D(CHAR, SEW, LMUL) D##CHAR##SEW##m##LMUL +-#define HWY_RVV_V(BASE, SEW, LMUL) v##BASE##SEW##m##LMUL##_t ++#define HWY_RVV_D(CHAR, SEW, LMUL) D##CHAR##SEW##LMUL ++#define HWY_RVV_V(BASE, SEW, LMUL) v##BASE##SEW##LMUL##_t + #define HWY_RVV_M(MLEN) vbool##MLEN##_t + + } // namespace detail + + // TODO(janwas): remove typedefs and only use HWY_RVV_V etc. directly + +-// TODO(janwas): do we want fractional LMUL? (can encode as negative) +-// Mixed-precision code can use LMUL 1..8 and that should be enough unless they +-// need many registers. +-#define HWY_SPECIALIZE(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ +- using HWY_RVV_D(CHAR, SEW, LMUL) = \ +- Simd; \ +- using V##CHAR##SEW##m##LMUL = HWY_RVV_V(BASE, SEW, LMUL); \ +- template <> \ +- struct DFromV_t { \ +- using Lane = HWY_RVV_T(BASE, SEW); \ +- using type = Simd; \ ++// Until we have full intrinsic support for fractional LMUL, mixed-precision ++// code can use LMUL 1..8 (adequate unless they need many registers). ++#define HWY_SPECIALIZE(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ using HWY_RVV_D(CHAR, SEW, LMUL) = Full; \ ++ using V##CHAR##SEW##LMUL = HWY_RVV_V(BASE, SEW, LMUL); \ ++ template <> \ ++ struct DFromV_t { \ ++ using Lane = HWY_RVV_T(BASE, SEW); \ ++ using type = Full; \ + }; + using Vf16m1 = vfloat16m1_t; + using Vf16m2 = vfloat16m2_t; + using Vf16m4 = vfloat16m4_t; + using Vf16m8 = vfloat16m8_t; +-using Df16m1 = Simd; +-using Df16m2 = Simd; +-using Df16m4 = Simd; +-using Df16m8 = Simd; ++using Df16m1 = Full; ++using Df16m2 = Full; ++using Df16m4 = Full; ++using Df16m8 = Full; + + HWY_RVV_FOREACH(HWY_SPECIALIZE, _, _) + #undef HWY_SPECIALIZE + + // vector = f(d), e.g. Zero +-#define HWY_RVV_RETV_ARGD(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ ++#define HWY_RVV_RETV_ARGD(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ + HWY_API HWY_RVV_V(BASE, SEW, LMUL) NAME(HWY_RVV_D(CHAR, SEW, LMUL) d) { \ + (void)Lanes(d); \ +- return v##OP##_##CHAR##SEW##m##LMUL(); \ ++ return v##OP##_##CHAR##SEW##LMUL(); \ + } + + // vector = f(vector), e.g. Not +-#define HWY_RVV_RETV_ARGV(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ ++#define HWY_RVV_RETV_ARGV(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ + HWY_API HWY_RVV_V(BASE, SEW, LMUL) NAME(HWY_RVV_V(BASE, SEW, LMUL) v) { \ +- return v##OP##_v_##CHAR##SEW##m##LMUL(v); \ ++ return v##OP##_v_##CHAR##SEW##LMUL(v); \ + } + + // vector = f(vector, scalar), e.g. detail::Add +-#define HWY_RVV_RETV_ARGVS(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ +- HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ +- NAME(HWY_RVV_V(BASE, SEW, LMUL) a, HWY_RVV_T(BASE, SEW) b) { \ +- return v##OP##_##CHAR##SEW##m##LMUL(a, b); \ ++#define HWY_RVV_RETV_ARGVS(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ ++ NAME(HWY_RVV_V(BASE, SEW, LMUL) a, HWY_RVV_T(BASE, SEW) b) { \ ++ return v##OP##_##CHAR##SEW##LMUL(a, b); \ + } + + // vector = f(vector, vector), e.g. Add +-#define HWY_RVV_RETV_ARGVV(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ ++#define HWY_RVV_RETV_ARGVV(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ + HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ + NAME(HWY_RVV_V(BASE, SEW, LMUL) a, HWY_RVV_V(BASE, SEW, LMUL) b) { \ +- return v##OP##_vv_##CHAR##SEW##m##LMUL(a, b); \ ++ return v##OP##_vv_##CHAR##SEW##LMUL(a, b); \ + } + + // ================================================== INIT +@@ -218,9 +222,9 @@ HWY_RVV_FOREACH(HWY_SPECIALIZE, _, _) + + // WARNING: we want to query VLMAX/sizeof(T), but this actually changes VL! + // vlenb is not exposed through intrinsics and vreadvl is not VLMAX. +-#define HWY_RVV_LANES(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ +- HWY_API size_t NAME(HWY_RVV_D(CHAR, SEW, LMUL) /* d */) { \ +- return v##OP##SEW##m##LMUL(); \ ++#define HWY_RVV_LANES(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ HWY_API size_t NAME(HWY_RVV_D(CHAR, SEW, LMUL) /* d */) { \ ++ return v##OP##SEW##LMUL(); \ + } + + HWY_RVV_FOREACH(HWY_RVV_LANES, Lanes, setvlmax_e) +@@ -233,19 +237,31 @@ HWY_RVV_FOREACH(HWY_RVV_RETV_ARGD, Zero, + template + using VFromD = decltype(Zero(D())); + ++// Partial ++template ++HWY_API VFromD> Zero(Simd /*tag*/) { ++ return Zero(Full()); ++} ++ + // ------------------------------ Set + // vector = f(d, scalar), e.g. Set +-#define HWY_RVV_SET(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ ++#define HWY_RVV_SET(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ + HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ + NAME(HWY_RVV_D(CHAR, SEW, LMUL) d, HWY_RVV_T(BASE, SEW) arg) { \ + (void)Lanes(d); \ +- return v##OP##_##CHAR##SEW##m##LMUL(arg); \ ++ return v##OP##_##CHAR##SEW##LMUL(arg); \ + } + + HWY_RVV_FOREACH_UI(HWY_RVV_SET, Set, mv_v_x) + HWY_RVV_FOREACH_F(HWY_RVV_SET, Set, fmv_v_f) + #undef HWY_RVV_SET + ++// Partial vectors ++template ++HWY_API VFromD> Set(Simd /*tag*/, T arg) { ++ return Set(Full(), arg); ++} ++ + // ------------------------------ Undefined + + // RVV vundefined is 'poisoned' such that even XORing a _variable_ initialized +@@ -265,7 +281,7 @@ HWY_API VFromD Undefined(D d) { + namespace detail { + + // u8: no change +-#define HWY_RVV_CAST_NOP(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ ++#define HWY_RVV_CAST_NOP(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ + HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ + BitCastToByte(HWY_RVV_V(BASE, SEW, LMUL) v) { \ + return v; \ +@@ -276,25 +292,25 @@ namespace detail { + } + + // Other integers +-#define HWY_RVV_CAST_UI(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ +- HWY_API vuint8m##LMUL##_t BitCastToByte(HWY_RVV_V(BASE, SEW, LMUL) v) { \ +- return v##OP##_v_##CHAR##SEW##m##LMUL##_u8m##LMUL(v); \ +- } \ +- HWY_API HWY_RVV_V(BASE, SEW, LMUL) BitCastFromByte( \ +- HWY_RVV_D(CHAR, SEW, LMUL) /* d */, vuint8m##LMUL##_t v) { \ +- return v##OP##_v_u8m##LMUL##_##CHAR##SEW##m##LMUL(v); \ ++#define HWY_RVV_CAST_UI(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ HWY_API vuint8##LMUL##_t BitCastToByte(HWY_RVV_V(BASE, SEW, LMUL) v) { \ ++ return v##OP##_v_##CHAR##SEW##LMUL##_u8##LMUL(v); \ ++ } \ ++ HWY_API HWY_RVV_V(BASE, SEW, LMUL) BitCastFromByte( \ ++ HWY_RVV_D(CHAR, SEW, LMUL) /* d */, vuint8##LMUL##_t v) { \ ++ return v##OP##_v_u8##LMUL##_##CHAR##SEW##LMUL(v); \ + } + + // Float: first cast to/from unsigned +-#define HWY_RVV_CAST_F(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ +- HWY_API vuint8m##LMUL##_t BitCastToByte(HWY_RVV_V(BASE, SEW, LMUL) v) { \ +- return v##OP##_v_u##SEW##m##LMUL##_u8m##LMUL( \ +- v##OP##_v_f##SEW##m##LMUL##_u##SEW##m##LMUL(v)); \ +- } \ +- HWY_API HWY_RVV_V(BASE, SEW, LMUL) BitCastFromByte( \ +- HWY_RVV_D(CHAR, SEW, LMUL) /* d */, vuint8m##LMUL##_t v) { \ +- return v##OP##_v_u##SEW##m##LMUL##_f##SEW##m##LMUL( \ +- v##OP##_v_u8m##LMUL##_u##SEW##m##LMUL(v)); \ ++#define HWY_RVV_CAST_F(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ HWY_API vuint8##LMUL##_t BitCastToByte(HWY_RVV_V(BASE, SEW, LMUL) v) { \ ++ return v##OP##_v_u##SEW##LMUL##_u8##LMUL( \ ++ v##OP##_v_f##SEW##LMUL##_u##SEW##LMUL(v)); \ ++ } \ ++ HWY_API HWY_RVV_V(BASE, SEW, LMUL) BitCastFromByte( \ ++ HWY_RVV_D(CHAR, SEW, LMUL) /* d */, vuint8##LMUL##_t v) { \ ++ return v##OP##_v_u##SEW##LMUL##_f##SEW##LMUL( \ ++ v##OP##_v_u8##LMUL##_u##SEW##LMUL(v)); \ + } + + HWY_RVV_FOREACH_U08(HWY_RVV_CAST_NOP, _, _) +@@ -315,6 +331,12 @@ HWY_API VFromD BitCast(D d, FromV v) + return detail::BitCastFromByte(d, detail::BitCastToByte(v)); + } + ++// Partial ++template ++HWY_API VFromD> BitCast(Simd /*tag*/, FromV v) { ++ return BitCast(Full(), v); ++} ++ + namespace detail { + + template >> +@@ -336,6 +358,12 @@ HWY_API VFromD Iota0(const D /*d*/) + return BitCastToUnsigned(Iota0(DU())); + } + ++// Partial ++template ++HWY_API VFromD> Iota0(Simd /*tag*/) { ++ return Iota0(Full()); ++} ++ + } // namespace detail + + // ================================================== LOGICAL +@@ -370,11 +398,11 @@ HWY_API V And(const V a, const V b) { + // ------------------------------ Or + + // Scalar argument plus mask. Used by VecFromMask. +-#define HWY_RVV_OR_MASK(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ ++#define HWY_RVV_OR_MASK(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ + HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ + NAME(HWY_RVV_V(BASE, SEW, LMUL) v, HWY_RVV_T(BASE, SEW) imm, \ + HWY_RVV_M(MLEN) mask, HWY_RVV_V(BASE, SEW, LMUL) maskedoff) { \ +- return v##OP##_##CHAR##SEW##m##LMUL##_m(mask, maskedoff, v, imm); \ ++ return v##OP##_##CHAR##SEW##LMUL##_m(mask, maskedoff, v, imm); \ + } + + namespace detail { +@@ -466,14 +494,14 @@ HWY_RVV_FOREACH_U16(HWY_RVV_RETV_ARGVV, + // ------------------------------ ShiftLeft[Same] + + // Intrinsics do not define .vi forms, so use .vx instead. +-#define HWY_RVV_SHIFT(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ +- template \ +- HWY_API HWY_RVV_V(BASE, SEW, LMUL) NAME(HWY_RVV_V(BASE, SEW, LMUL) v) { \ +- return v##OP##_vx_##CHAR##SEW##m##LMUL(v, kBits); \ +- } \ +- HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ +- NAME##Same(HWY_RVV_V(BASE, SEW, LMUL) v, int bits) { \ +- return v##OP##_vx_##CHAR##SEW##m##LMUL(v, static_cast(bits)); \ ++#define HWY_RVV_SHIFT(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ template \ ++ HWY_API HWY_RVV_V(BASE, SEW, LMUL) NAME(HWY_RVV_V(BASE, SEW, LMUL) v) { \ ++ return v##OP##_vx_##CHAR##SEW##LMUL(v, kBits); \ ++ } \ ++ HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ ++ NAME##Same(HWY_RVV_V(BASE, SEW, LMUL) v, int bits) { \ ++ return v##OP##_vx_##CHAR##SEW##LMUL(v, static_cast(bits)); \ + } + + HWY_RVV_FOREACH_UI(HWY_RVV_SHIFT, ShiftLeft, sll) +@@ -486,19 +514,18 @@ HWY_RVV_FOREACH_I(HWY_RVV_SHIFT, ShiftRi + #undef HWY_RVV_SHIFT + + // ------------------------------ Shl +-#define HWY_RVV_SHIFT_VV(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ ++#define HWY_RVV_SHIFT_VV(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ + HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ + NAME(HWY_RVV_V(BASE, SEW, LMUL) v, HWY_RVV_V(BASE, SEW, LMUL) bits) { \ +- return v##OP##_vv_##CHAR##SEW##m##LMUL(v, bits); \ ++ return v##OP##_vv_##CHAR##SEW##LMUL(v, bits); \ + } + + HWY_RVV_FOREACH_U(HWY_RVV_SHIFT_VV, Shl, sll) + +-#define HWY_RVV_SHIFT_II(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ ++#define HWY_RVV_SHIFT_II(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ + HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ + NAME(HWY_RVV_V(BASE, SEW, LMUL) v, HWY_RVV_V(BASE, SEW, LMUL) bits) { \ +- return v##OP##_vv_##CHAR##SEW##m##LMUL(v, \ +- detail::BitCastToUnsigned(bits)); \ ++ return v##OP##_vv_##CHAR##SEW##LMUL(v, detail::BitCastToUnsigned(bits)); \ + } + + HWY_RVV_FOREACH_I(HWY_RVV_SHIFT_II, Shl, sll) +@@ -569,11 +596,11 @@ HWY_API V ApproximateReciprocalSqrt(cons + + // ------------------------------ MulAdd + // Note: op is still named vv, not vvv. +-#define HWY_RVV_FMA(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ ++#define HWY_RVV_FMA(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ + HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ + NAME(HWY_RVV_V(BASE, SEW, LMUL) mul, HWY_RVV_V(BASE, SEW, LMUL) x, \ + HWY_RVV_V(BASE, SEW, LMUL) add) { \ +- return v##OP##_vv_##CHAR##SEW##m##LMUL(add, mul, x); \ ++ return v##OP##_vv_##CHAR##SEW##LMUL(add, mul, x); \ + } + + HWY_RVV_FOREACH_F(HWY_RVV_FMA, MulAdd, fmacc) +@@ -596,11 +623,11 @@ HWY_RVV_FOREACH_F(HWY_RVV_FMA, NegMulSub + // of all bits; SLEN 8 / LMUL 4 = half of all bits. + + // mask = f(vector, vector) +-#define HWY_RVV_RETM_ARGVV(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ ++#define HWY_RVV_RETM_ARGVV(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ + HWY_API HWY_RVV_M(MLEN) \ + NAME(HWY_RVV_V(BASE, SEW, LMUL) a, HWY_RVV_V(BASE, SEW, LMUL) b) { \ + (void)Lanes(DFromV()); \ +- return v##OP##_vv_##CHAR##SEW##m##LMUL##_b##MLEN(a, b); \ ++ return v##OP##_vv_##CHAR##SEW##LMUL##_b##MLEN(a, b); \ + } + + // ------------------------------ Eq +@@ -675,11 +702,11 @@ HWY_RVV_FOREACH_B(HWY_RVV_RETM_ARGMM, Xo + #undef HWY_RVV_RETM_ARGMM + + // ------------------------------ IfThenElse +-#define HWY_RVV_IF_THEN_ELSE(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ +- HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ +- NAME(HWY_RVV_M(MLEN) m, HWY_RVV_V(BASE, SEW, LMUL) yes, \ +- HWY_RVV_V(BASE, SEW, LMUL) no) { \ +- return v##OP##_vvm_##CHAR##SEW##m##LMUL(m, no, yes); \ ++#define HWY_RVV_IF_THEN_ELSE(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ ++ NAME(HWY_RVV_M(MLEN) m, HWY_RVV_V(BASE, SEW, LMUL) yes, \ ++ HWY_RVV_V(BASE, SEW, LMUL) no) { \ ++ return v##OP##_vvm_##CHAR##SEW##LMUL(m, no, yes); \ + } + + HWY_RVV_FOREACH(HWY_RVV_IF_THEN_ELSE, IfThenElse, merge) +@@ -774,17 +801,17 @@ HWY_RVV_FOREACH_B(HWY_RVV_COUNT_TRUE, _, + + // ------------------------------ Load + +-#define HWY_RVV_LOAD(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ +- HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ +- NAME(HWY_RVV_D(CHAR, SEW, LMUL) d, \ +- const HWY_RVV_T(BASE, SEW) * HWY_RESTRICT p) { \ +- (void)Lanes(d); \ +- return v##OP##SEW##_v_##CHAR##SEW##m##LMUL(p); \ ++#define HWY_RVV_LOAD(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ ++ NAME(HWY_RVV_D(CHAR, SEW, LMUL) d, \ ++ const HWY_RVV_T(BASE, SEW) * HWY_RESTRICT p) { \ ++ (void)Lanes(d); \ ++ return v##OP##SEW##_v_##CHAR##SEW##LMUL(p); \ + } + HWY_RVV_FOREACH(HWY_RVV_LOAD, Load, le) + #undef HWY_RVV_LOAD + +-// Partial load ++// Partial + template + HWY_API VFromD> Load(Simd d, const T* HWY_RESTRICT p) { + return Load(d, p); +@@ -800,16 +827,22 @@ HWY_API VFromD LoadU(D d, const TFrom + + // ------------------------------ Store + +-#define HWY_RVV_RET_ARGVDP(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ +- HWY_API void NAME(HWY_RVV_V(BASE, SEW, LMUL) v, \ +- HWY_RVV_D(CHAR, SEW, LMUL) d, \ +- HWY_RVV_T(BASE, SEW) * HWY_RESTRICT p) { \ +- (void)Lanes(d); \ +- return v##OP##SEW##_v_##CHAR##SEW##m##LMUL(p, v); \ ++#define HWY_RVV_RET_ARGVDP(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ HWY_API void NAME(HWY_RVV_V(BASE, SEW, LMUL) v, \ ++ HWY_RVV_D(CHAR, SEW, LMUL) d, \ ++ HWY_RVV_T(BASE, SEW) * HWY_RESTRICT p) { \ ++ (void)Lanes(d); \ ++ return v##OP##SEW##_v_##CHAR##SEW##LMUL(p, v); \ + } + HWY_RVV_FOREACH(HWY_RVV_RET_ARGVDP, Store, se) + #undef HWY_RVV_RET_ARGVDP + ++// Partial ++template ++HWY_API void Store(VFromD> v, Simd d, T* HWY_RESTRICT p) { ++ return Store(v, Full(), p); ++} ++ + // ------------------------------ StoreU + + // RVV only requires lane alignment, not natural alignment of the entire vector. +@@ -963,67 +996,6 @@ HWY_API VFromD> Promote + return BitCast(d, PromoteTo(Simd(), v)); + } + +-// ------------------------------ PromoteTo I +- +-HWY_API Vi16m2 PromoteTo(Di16m2 /* d */, Vi8m1 v) { return vsext_vf2_i16m2(v); } +-HWY_API Vi16m4 PromoteTo(Di16m4 /* d */, Vi8m2 v) { return vsext_vf2_i16m4(v); } +-HWY_API Vi16m8 PromoteTo(Di16m8 /* d */, Vi8m4 v) { return vsext_vf2_i16m8(v); } +- +-HWY_API Vi32m4 PromoteTo(Di32m4 /* d */, Vi8m1 v) { return vsext_vf4_i32m4(v); } +-HWY_API Vi32m8 PromoteTo(Di32m8 /* d */, Vi8m2 v) { return vsext_vf4_i32m8(v); } +- +-HWY_API Vi32m2 PromoteTo(Di32m2 /* d */, const Vi16m1 v) { +- return vsext_vf2_i32m2(v); +-} +-HWY_API Vi32m4 PromoteTo(Di32m4 /* d */, const Vi16m2 v) { +- return vsext_vf2_i32m4(v); +-} +-HWY_API Vi32m8 PromoteTo(Di32m8 /* d */, const Vi16m4 v) { +- return vsext_vf2_i32m8(v); +-} +- +-HWY_API Vi64m2 PromoteTo(Di64m2 /* d */, const Vi32m1 v) { +- return vsext_vf2_i64m2(v); +-} +-HWY_API Vi64m4 PromoteTo(Di64m4 /* d */, const Vi32m2 v) { +- return vsext_vf2_i64m4(v); +-} +-HWY_API Vi64m8 PromoteTo(Di64m8 /* d */, const Vi32m4 v) { +- return vsext_vf2_i64m8(v); +-} +- +-// ------------------------------ PromoteTo F +- +-HWY_API Vf32m2 PromoteTo(Df32m2 /* d */, const Vf16m1 v) { +- return vfwcvt_f_f_v_f32m2(v); +-} +-HWY_API Vf32m4 PromoteTo(Df32m4 /* d */, const Vf16m2 v) { +- return vfwcvt_f_f_v_f32m4(v); +-} +-HWY_API Vf32m8 PromoteTo(Df32m8 /* d */, const Vf16m4 v) { +- return vfwcvt_f_f_v_f32m8(v); +-} +- +-HWY_API Vf64m2 PromoteTo(Df64m2 /* d */, const Vf32m1 v) { +- return vfwcvt_f_f_v_f64m2(v); +-} +-HWY_API Vf64m4 PromoteTo(Df64m4 /* d */, const Vf32m2 v) { +- return vfwcvt_f_f_v_f64m4(v); +-} +-HWY_API Vf64m8 PromoteTo(Df64m8 /* d */, const Vf32m4 v) { +- return vfwcvt_f_f_v_f64m8(v); +-} +- +-HWY_API Vf64m2 PromoteTo(Df64m2 /* d */, const Vi32m1 v) { +- return vfwcvt_f_x_v_f64m2(v); +-} +-HWY_API Vf64m4 PromoteTo(Df64m4 /* d */, const Vi32m2 v) { +- return vfwcvt_f_x_v_f64m4(v); +-} +-HWY_API Vf64m8 PromoteTo(Df64m8 /* d */, const Vi32m4 v) { +- return vfwcvt_f_x_v_f64m8(v); +-} +- + // ------------------------------ DemoteTo U + + // First clamp negative numbers to zero to match x86 packus. +@@ -1124,19 +1096,19 @@ HWY_API Vi32m4 DemoteTo(Di32m4 /* d */, + + // ------------------------------ ConvertTo F + +-#define HWY_RVV_CONVERT(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ ++#define HWY_RVV_CONVERT(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ + HWY_API HWY_RVV_V(BASE, SEW, LMUL) ConvertTo( \ + HWY_RVV_D(CHAR, SEW, LMUL) /* d */, HWY_RVV_V(int, SEW, LMUL) v) { \ +- return vfcvt_f_x_v_f##SEW##m##LMUL(v); \ ++ return vfcvt_f_x_v_f##SEW##LMUL(v); \ + } \ + /* Truncates (rounds toward zero). */ \ + HWY_API HWY_RVV_V(int, SEW, LMUL) ConvertTo(HWY_RVV_D(i, SEW, LMUL) /* d */, \ + HWY_RVV_V(BASE, SEW, LMUL) v) { \ +- return vfcvt_rtz_x_f_v_i##SEW##m##LMUL(v); \ ++ return vfcvt_rtz_x_f_v_i##SEW##LMUL(v); \ + } \ + /* Uses default rounding mode. */ \ + HWY_API HWY_RVV_V(int, SEW, LMUL) NearestInt(HWY_RVV_V(BASE, SEW, LMUL) v) { \ +- return vfcvt_x_f_v_i##SEW##m##LMUL(v); \ ++ return vfcvt_x_f_v_i##SEW##LMUL(v); \ + } + + // API only requires f32 but we provide f64 for internal use (otherwise, it +@@ -1184,10 +1156,10 @@ HWY_API VFromD SetTableIndices(D d, + + // <32bit are not part of Highway API, but used in Broadcast. This limits VLMAX + // to 2048! We could instead use vrgatherei16. +-#define HWY_RVV_TABLE(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ ++#define HWY_RVV_TABLE(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ + HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ + NAME(HWY_RVV_V(BASE, SEW, LMUL) v, HWY_RVV_V(uint, SEW, LMUL) idx) { \ +- return v##OP##_vv_##CHAR##SEW##m##LMUL(v, idx); \ ++ return v##OP##_vv_##CHAR##SEW##LMUL(v, idx); \ + } + + HWY_RVV_FOREACH(HWY_RVV_TABLE, TableLookupLanes, rgather) +@@ -1279,7 +1251,6 @@ HWY_API V OffsetsOf128BitBlocks(const D + using T = MakeUnsigned>; + return detail::And(iota0, static_cast(~(LanesPerBlock(d) - 1))); + } +- + } // namespace detail + + template +@@ -1307,9 +1278,9 @@ HWY_API V Broadcast(const V v) { + + // ------------------------------ GetLane + +-#define HWY_RVV_GET_LANE(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ +- HWY_API HWY_RVV_T(BASE, SEW) NAME(HWY_RVV_V(BASE, SEW, LMUL) v) { \ +- return v##OP##_s_##CHAR##SEW##m##LMUL##_##CHAR##SEW(v); \ ++#define HWY_RVV_GET_LANE(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ HWY_API HWY_RVV_T(BASE, SEW) NAME(HWY_RVV_V(BASE, SEW, LMUL) v) { \ ++ return v##OP##_s_##CHAR##SEW##LMUL##_##CHAR##SEW(v); \ + } + + HWY_RVV_FOREACH_UI(HWY_RVV_GET_LANE, GetLane, mv_x) +@@ -1318,11 +1289,12 @@ HWY_RVV_FOREACH_F(HWY_RVV_GET_LANE, GetL + + // ------------------------------ ShiftLeftLanes + +-// vector = f(vector, size_t) +-#define HWY_RVV_SLIDE(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ +- HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ +- NAME(HWY_RVV_V(BASE, SEW, LMUL) v, size_t lanes) { \ +- return v##OP##_vx_##CHAR##SEW##m##LMUL(v, v, lanes); \ ++// vector = f(vector, vector, size_t) ++#define HWY_RVV_SLIDE(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ ++ NAME(HWY_RVV_V(BASE, SEW, LMUL) dst, HWY_RVV_V(BASE, SEW, LMUL) src, \ ++ size_t lanes) { \ ++ return v##OP##_vx_##CHAR##SEW##LMUL(dst, src, lanes); \ + } + + namespace detail { +@@ -1333,7 +1305,7 @@ template + HWY_API V ShiftLeftLanes(const V v) { + using D = DFromV; + const RebindToSigned di; +- const auto shifted = detail::SlideUp(v, kLanes); ++ const auto shifted = detail::SlideUp(v, v, kLanes); + // Match x86 semantics by zeroing lower lanes in 128-bit blocks + constexpr size_t kLanesPerBlock = detail::LanesPerBlock(di); + const auto idx_mod = detail::And(detail::Iota0(di), kLanesPerBlock - 1); +@@ -1363,7 +1335,7 @@ template + HWY_API V ShiftRightLanes(const V v) { + using D = DFromV; + const RebindToSigned di; +- const auto shifted = detail::SlideDown(v, kLanes); ++ const auto shifted = detail::SlideDown(v, v, kLanes); + // Match x86 semantics by zeroing upper lanes in 128-bit blocks + constexpr size_t kLanesPerBlock = detail::LanesPerBlock(di); + const auto idx_mod = detail::And(detail::Iota0(di), kLanesPerBlock - 1); +@@ -1405,7 +1377,7 @@ HWY_API V ConcatUpperLower(const V hi, c + template + HWY_API V ConcatLowerLower(const V hi, const V lo) { + // Move lower half into upper +- const auto hi_up = detail::SlideUp(hi, Lanes(DFromV()) / 2); ++ const auto hi_up = detail::SlideUp(hi, hi, Lanes(DFromV()) / 2); + return ConcatUpperLower(hi_up, lo); + } + +@@ -1414,7 +1386,7 @@ HWY_API V ConcatLowerLower(const V hi, c + template + HWY_API V ConcatUpperUpper(const V hi, const V lo) { + // Move upper half into lower +- const auto lo_down = detail::SlideDown(lo, Lanes(DFromV()) / 2); ++ const auto lo_down = detail::SlideDown(lo, lo, Lanes(DFromV()) / 2); + return ConcatUpperLower(hi, lo_down); + } + +@@ -1423,8 +1395,8 @@ HWY_API V ConcatUpperUpper(const V hi, c + template + HWY_API V ConcatLowerUpper(const V hi, const V lo) { + // Move half of both inputs to the other half +- const auto hi_up = detail::SlideUp(hi, Lanes(DFromV()) / 2); +- const auto lo_down = detail::SlideDown(lo, Lanes(DFromV()) / 2); ++ const auto hi_up = detail::SlideUp(hi, hi, Lanes(DFromV()) / 2); ++ const auto lo_down = detail::SlideDown(lo, lo, Lanes(DFromV()) / 2); + return ConcatUpperLower(hi_up, lo_down); + } + +@@ -1491,61 +1463,55 @@ HWY_API V Combine(const V a, const V b) + // ================================================== REDUCE + + // vector = f(vector, zero_m1) +-#define HWY_RVV_REDUCE(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ +- HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ +- NAME(HWY_RVV_V(BASE, SEW, LMUL) v, HWY_RVV_V(BASE, SEW, 1) v0) { \ +- vsetvlmax_e##SEW##m##LMUL(); \ +- return Set(HWY_RVV_D(CHAR, SEW, LMUL)(), \ +- GetLane(v##OP##_vs_##CHAR##SEW##m##LMUL##_##CHAR##SEW##m1( \ +- v0, v, v0))); \ ++#define HWY_RVV_REDUCE(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ ++ HWY_API HWY_RVV_V(BASE, SEW, LMUL) \ ++ NAME(HWY_RVV_V(BASE, SEW, LMUL) v, HWY_RVV_V(BASE, SEW, m1) v0) { \ ++ vsetvlmax_e##SEW##LMUL(); \ ++ return Set( \ ++ HWY_RVV_D(CHAR, SEW, LMUL)(), \ ++ GetLane(v##OP##_vs_##CHAR##SEW##LMUL##_##CHAR##SEW##m1(v0, v, v0))); \ + } + + // ------------------------------ SumOfLanes + + namespace detail { +- + HWY_RVV_FOREACH_UI(HWY_RVV_REDUCE, RedSum, redsum) + HWY_RVV_FOREACH_F(HWY_RVV_REDUCE, RedSum, fredsum) +- + } // namespace detail + + template + HWY_API V SumOfLanes(const V v) { + using T = TFromV; +- const auto v0 = Zero(Simd()); // always m1 ++ const auto v0 = Zero(Full()); // always m1 + return detail::RedSum(v, v0); + } + + // ------------------------------ MinOfLanes + namespace detail { +- + HWY_RVV_FOREACH_U(HWY_RVV_REDUCE, RedMin, redminu) + HWY_RVV_FOREACH_I(HWY_RVV_REDUCE, RedMin, redmin) + HWY_RVV_FOREACH_F(HWY_RVV_REDUCE, RedMin, fredmin) +- + } // namespace detail + + template + HWY_API V MinOfLanes(const V v) { + using T = TFromV; +- const Simd d1; // always m1 ++ const Full d1; // always m1 + const auto neutral = Set(d1, HighestValue()); + return detail::RedMin(v, neutral); + } + + // ------------------------------ MaxOfLanes + namespace detail { +- + HWY_RVV_FOREACH_U(HWY_RVV_REDUCE, RedMax, redmaxu) + HWY_RVV_FOREACH_I(HWY_RVV_REDUCE, RedMax, redmax) + HWY_RVV_FOREACH_F(HWY_RVV_REDUCE, RedMax, fredmax) +- + } // namespace detail + + template + HWY_API V MaxOfLanes(const V v) { + using T = TFromV; +- const Simd d1; // always m1 ++ const Full d1; // always m1 + const auto neutral = Set(d1, LowestValue()); + return detail::RedMax(v, neutral); + } +@@ -1570,7 +1536,7 @@ HWY_API VFromD LoadDup128(D d, const + #define HWY_RVV_STORE_MASK_BITS(MLEN, NAME, OP) \ + HWY_API size_t StoreMaskBits(HWY_RVV_M(MLEN) m, uint8_t* p) { \ + /* LMUL=1 is always enough */ \ +- Simd d8; \ ++ Full d8; \ + const size_t num_bytes = (Lanes(d8) + MLEN - 1) / MLEN; \ + /* TODO(janwas): how to convert vbool* to vuint?*/ \ + /*Store(m, d8, p);*/ \ +@@ -1581,6 +1547,22 @@ HWY_API VFromD LoadDup128(D d, const + HWY_RVV_FOREACH_B(HWY_RVV_STORE_MASK_BITS, _, _) + #undef HWY_RVV_STORE_MASK_BITS + ++// ------------------------------ FirstN (Iota0, Lt, RebindMask, SlideUp) ++ ++// Disallow for 8-bit because Iota is likely to overflow. ++template ++HWY_API MFromD FirstN(const D d, const size_t n) { ++ const RebindToSigned di; ++ return RebindMask(d, Lt(BitCast(di, detail::Iota0(d)), Set(di, n))); ++} ++ ++template ++HWY_API MFromD FirstN(const D d, const size_t n) { ++ const auto zero = Zero(d); ++ const auto one = Set(d, 1); ++ return Eq(detail::SlideUp(one, zero, n), one); ++} ++ + // ------------------------------ Neg + + template +@@ -1589,9 +1571,9 @@ HWY_API V Neg(const V v) { + } + + // vector = f(vector), but argument is repeated +-#define HWY_RVV_RETV_ARGV2(BASE, CHAR, SEW, LMUL, MLEN, NAME, OP) \ ++#define HWY_RVV_RETV_ARGV2(BASE, CHAR, SEW, LMUL, SHIFT, MLEN, NAME, OP) \ + HWY_API HWY_RVV_V(BASE, SEW, LMUL) NAME(HWY_RVV_V(BASE, SEW, LMUL) v) { \ +- return v##OP##_vv_##CHAR##SEW##m##LMUL(v, v); \ ++ return v##OP##_vv_##CHAR##SEW##LMUL(v, v); \ + } + + HWY_RVV_FOREACH_F(HWY_RVV_RETV_ARGV2, Neg, fsgnjn) +@@ -1628,7 +1610,6 @@ template + HWY_API auto UseInt(const V v) -> decltype(MaskFromVec(v)) { + return Lt(Abs(v), Set(DFromV(), MantissaEnd>())); + } +- + } // namespace detail + + template +@@ -1699,10 +1680,8 @@ HWY_API VFromD Iota(const D d, TFromD + // Using vwmul does not work for m8, so use mulh instead. Highway only provides + // MulHigh for 16-bit, so use a private wrapper. + namespace detail { +- + HWY_RVV_FOREACH_U32(HWY_RVV_RETV_ARGVV, MulHigh, mulhu) + HWY_RVV_FOREACH_I32(HWY_RVV_RETV_ARGVV, MulHigh, mulh) +- + } // namespace detail + + template +@@ -1712,7 +1691,7 @@ HWY_API VFromD> dw; +- return BitCast(dw, OddEven(detail::SlideUp(hi, 1), lo)); ++ return BitCast(dw, OddEven(detail::SlideUp(hi, hi, 1), lo)); + } + + // ================================================== END MACROS +diff -up chromium-92.0.4515.107/third_party/highway/src/hwy/ops/x86_128-inl.h.update-highway-0.12.2 chromium-92.0.4515.107/third_party/highway/src/hwy/ops/x86_128-inl.h +--- chromium-92.0.4515.107/third_party/highway/src/hwy/ops/x86_128-inl.h.update-highway-0.12.2 2021-07-19 14:47:23.000000000 -0400 ++++ chromium-92.0.4515.107/third_party/highway/src/hwy/ops/x86_128-inl.h 2021-07-26 17:19:52.153729522 -0400 +@@ -154,27 +154,28 @@ HWY_API Vec128 Zero(Simd + HWY_API Vec128 Set(Simd /* tag */, const uint8_t t) { +- return Vec128{_mm_set1_epi8(t)}; ++ return Vec128{_mm_set1_epi8(static_cast(t))}; // NOLINT + } + template + HWY_API Vec128 Set(Simd /* tag */, const uint16_t t) { +- return Vec128{_mm_set1_epi16(t)}; ++ return Vec128{_mm_set1_epi16(static_cast(t))}; // NOLINT + } + template + HWY_API Vec128 Set(Simd /* tag */, const uint32_t t) { +- return Vec128{_mm_set1_epi32(t)}; ++ return Vec128{_mm_set1_epi32(static_cast(t))}; + } + template + HWY_API Vec128 Set(Simd /* tag */, const uint64_t t) { +- return Vec128{_mm_set1_epi64x(t)}; ++ return Vec128{ ++ _mm_set1_epi64x(static_cast(t))}; // NOLINT + } + template + HWY_API Vec128 Set(Simd /* tag */, const int8_t t) { +- return Vec128{_mm_set1_epi8(t)}; ++ return Vec128{_mm_set1_epi8(static_cast(t))}; // NOLINT + } + template + HWY_API Vec128 Set(Simd /* tag */, const int16_t t) { +- return Vec128{_mm_set1_epi16(t)}; ++ return Vec128{_mm_set1_epi16(static_cast(t))}; // NOLINT + } + template + HWY_API Vec128 Set(Simd /* tag */, const int32_t t) { +@@ -182,7 +183,8 @@ HWY_API Vec128 Set(Simd + HWY_API Vec128 Set(Simd /* tag */, const int64_t t) { +- return Vec128{_mm_set1_epi64x(t)}; ++ return Vec128{ ++ _mm_set1_epi64x(static_cast(t))}; // NOLINT + } + template + HWY_API Vec128 Set(Simd /* tag */, const float t) { +@@ -684,6 +686,14 @@ HWY_API Mask128 operator>=(co + return Mask128{_mm_cmpge_pd(a.raw, b.raw)}; + } + ++// ------------------------------ FirstN (Iota, Lt) ++ ++template ++HWY_API Mask128 FirstN(const Simd d, size_t num) { ++ const RebindToSigned di; // Signed comparisons are cheaper. ++ return RebindMask(d, Iota(di, 0) < Set(di, static_cast>(num))); ++} ++ + // ================================================== ARITHMETIC + + // ------------------------------ Addition +@@ -895,7 +905,7 @@ template + HWY_API Vec128 Abs(const Vec128 v) { + return Vec128{_mm_abs_epi32(v.raw)}; + } +- ++// i64 is implemented after BroadcastSignBit. + template + HWY_API Vec128 Abs(const Vec128 v) { + const Vec128 mask{_mm_set1_epi32(0x7FFFFFFF)}; +@@ -1067,15 +1077,24 @@ HWY_API Vec128 BroadcastSign + return VecFromMask(v < Zero(Simd())); + #else + // Efficient Gt() requires SSE4.2 but we only have SSE4.1. BLENDVPD requires +- // two constants and domain crossing. 32-bit compare only requires Zero() +- // plus a shuffle to replicate the upper 32 bits. ++ // two constants and domain crossing. 32-bit shift avoids generating a zero. + const Simd d32; +- const auto sign = BitCast(d32, v) < Zero(d32); ++ const auto sign = ShiftRight<31>(BitCast(d32, v)); + return Vec128{ + _mm_shuffle_epi32(sign.raw, _MM_SHUFFLE(3, 3, 1, 1))}; + #endif + } + ++template ++HWY_API Vec128 Abs(const Vec128 v) { ++#if HWY_TARGET == HWY_AVX3 ++ return Vec128{_mm_abs_epi64(v.raw)}; ++#else ++ const auto zero = Zero(Simd()); ++ return IfThenElse(MaskFromVec(BroadcastSignBit(v)), zero - v, v); ++#endif ++} ++ + template + HWY_API Vec128 ShiftRight(const Vec128 v) { + #if HWY_TARGET == HWY_AVX3 +@@ -1787,6 +1806,10 @@ HWY_API void Stream(const Vec128 GatherIndex(Si + + #endif // HWY_TARGET != HWY_SSE4 + ++HWY_DIAGNOSTICS(pop) ++ + // ================================================== SWIZZLE + + // ------------------------------ Extract half +@@ -2075,10 +2100,10 @@ HWY_INLINE Vec128 UpperHalf(V + // ------------------------------ Shift vector by constant #bytes + + // 0x01..0F, kBytes = 1 => 0x02..0F00 +-template +-HWY_API Vec128 ShiftLeftBytes(const Vec128 v) { ++template ++HWY_API Vec128 ShiftLeftBytes(const Vec128 v) { + static_assert(0 <= kBytes && kBytes <= 16, "Invalid kBytes"); +- return Vec128{_mm_slli_si128(v.raw, kBytes)}; ++ return Vec128{_mm_slli_si128(v.raw, kBytes)}; + } + + template +@@ -2089,10 +2114,10 @@ HWY_API Vec128 ShiftLeftLanes(cons + } + + // 0x01..0F, kBytes = 1 => 0x0001..0E +-template +-HWY_API Vec128 ShiftRightBytes(const Vec128 v) { ++template ++HWY_API Vec128 ShiftRightBytes(const Vec128 v) { + static_assert(0 <= kBytes && kBytes <= 16, "Invalid kBytes"); +- return Vec128{_mm_srli_si128(v.raw, kBytes)}; ++ return Vec128{_mm_srli_si128(v.raw, kBytes)}; + } + + template +@@ -2257,44 +2282,47 @@ HWY_API Vec128 Shuffle0123(const + // ------------------------------ TableLookupLanes + + // Returned by SetTableIndices for use by TableLookupLanes. +-template ++template + struct Indices128 { + __m128i raw; + }; + +-template +-HWY_API Indices128 SetTableIndices(Full128, const int32_t* idx) { ++template ++HWY_API Indices128 SetTableIndices(Simd d, const int32_t* idx) { + #if !defined(NDEBUG) || defined(ADDRESS_SANITIZER) +- const size_t N = 16 / sizeof(T); + for (size_t i = 0; i < N; ++i) { + HWY_DASSERT(0 <= idx[i] && idx[i] < static_cast(N)); + } + #endif + +- const Full128 d8; +- alignas(16) uint8_t control[16]; +- for (size_t idx_byte = 0; idx_byte < 16; ++idx_byte) { +- const size_t idx_lane = idx_byte / sizeof(T); +- const size_t mod = idx_byte % sizeof(T); +- control[idx_byte] = static_cast(idx[idx_lane] * sizeof(T) + mod); ++ const Repartition d8; ++ alignas(16) uint8_t control[16] = {0}; ++ for (size_t idx_lane = 0; idx_lane < N; ++idx_lane) { ++ for (size_t idx_byte = 0; idx_byte < sizeof(T); ++idx_byte) { ++ control[idx_lane * sizeof(T) + idx_byte] = ++ static_cast(idx[idx_lane] * sizeof(T) + idx_byte); ++ } + } +- return Indices128{Load(d8, control).raw}; ++ return Indices128{Load(d8, control).raw}; + } + +-HWY_API Vec128 TableLookupLanes(const Vec128 v, +- const Indices128 idx) { +- return TableLookupBytes(v, Vec128{idx.raw}); ++template ++HWY_API Vec128 TableLookupLanes( ++ const Vec128 v, const Indices128 idx) { ++ return TableLookupBytes(v, Vec128{idx.raw}); + } +-HWY_API Vec128 TableLookupLanes(const Vec128 v, +- const Indices128 idx) { +- return TableLookupBytes(v, Vec128{idx.raw}); ++template ++HWY_API Vec128 TableLookupLanes(const Vec128 v, ++ const Indices128 idx) { ++ return TableLookupBytes(v, Vec128{idx.raw}); + } +-HWY_API Vec128 TableLookupLanes(const Vec128 v, +- const Indices128 idx) { +- const Full128 di; +- const Full128 df; ++template ++HWY_API Vec128 TableLookupLanes(const Vec128 v, ++ const Indices128 idx) { ++ const Simd di; ++ const Simd df; + return BitCast(df, +- TableLookupBytes(BitCast(di, v), Vec128{idx.raw})); ++ TableLookupBytes(BitCast(di, v), Vec128{idx.raw})); + } + + // ------------------------------ Interleave lanes +@@ -2502,47 +2530,47 @@ HWY_INLINE Vec128 ConcatUpperLow + + namespace detail { + +-template +-HWY_API Vec128 OddEven(hwy::SizeTag<1> /* tag */, const Vec128 a, +- const Vec128 b) { +- const Full128 d; +- const Full128 d8; ++template ++HWY_API Vec128 OddEven(hwy::SizeTag<1> /* tag */, const Vec128 a, ++ const Vec128 b) { ++ const Simd d; ++ const Repartition d8; + alignas(16) constexpr uint8_t mask[16] = {0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, + 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0}; + return IfThenElse(MaskFromVec(BitCast(d, Load(d8, mask))), b, a); + } +-template +-HWY_API Vec128 OddEven(hwy::SizeTag<2> /* tag */, const Vec128 a, +- const Vec128 b) { +- return Vec128{_mm_blend_epi16(a.raw, b.raw, 0x55)}; ++template ++HWY_API Vec128 OddEven(hwy::SizeTag<2> /* tag */, const Vec128 a, ++ const Vec128 b) { ++ return Vec128{_mm_blend_epi16(a.raw, b.raw, 0x55)}; + } +-template +-HWY_API Vec128 OddEven(hwy::SizeTag<4> /* tag */, const Vec128 a, +- const Vec128 b) { +- return Vec128{_mm_blend_epi16(a.raw, b.raw, 0x33)}; ++template ++HWY_API Vec128 OddEven(hwy::SizeTag<4> /* tag */, const Vec128 a, ++ const Vec128 b) { ++ return Vec128{_mm_blend_epi16(a.raw, b.raw, 0x33)}; + } +-template +-HWY_API Vec128 OddEven(hwy::SizeTag<8> /* tag */, const Vec128 a, +- const Vec128 b) { +- return Vec128{_mm_blend_epi16(a.raw, b.raw, 0x0F)}; ++template ++HWY_API Vec128 OddEven(hwy::SizeTag<8> /* tag */, const Vec128 a, ++ const Vec128 b) { ++ return Vec128{_mm_blend_epi16(a.raw, b.raw, 0x0F)}; + } + + } // namespace detail + +-template +-HWY_API Vec128 OddEven(const Vec128 a, const Vec128 b) { ++template ++HWY_API Vec128 OddEven(const Vec128 a, const Vec128 b) { + return detail::OddEven(hwy::SizeTag(), a, b); + } +-template <> +-HWY_INLINE Vec128 OddEven(const Vec128 a, +- const Vec128 b) { +- return Vec128{_mm_blend_ps(a.raw, b.raw, 5)}; ++template ++HWY_INLINE Vec128 OddEven(const Vec128 a, ++ const Vec128 b) { ++ return Vec128{_mm_blend_ps(a.raw, b.raw, 5)}; + } + +-template <> +-HWY_INLINE Vec128 OddEven(const Vec128 a, +- const Vec128 b) { +- return Vec128{_mm_blend_pd(a.raw, b.raw, 1)}; ++template ++HWY_INLINE Vec128 OddEven(const Vec128 a, ++ const Vec128 b) { ++ return Vec128{_mm_blend_pd(a.raw, b.raw, 1)}; + } + + // ------------------------------ Shl (ZipLower, Mul) +@@ -2980,7 +3008,7 @@ HWY_API Vec128 U8FromU32(con + return LowerHalf(LowerHalf(BitCast(d8, quad))); + } + +-// ------------------------------ Convert integer <=> floating point ++// ------------------------------ Integer <=> fp (ShiftRight, OddEven) + + template + HWY_API Vec128 ConvertTo(Simd /* tag */, +@@ -2995,13 +3023,20 @@ HWY_API Vec128 ConvertTo(Simd + (void)dd; + return Vec128{_mm_cvtepi64_pd(v.raw)}; + #else +- alignas(16) int64_t lanes_i[2]; +- Store(v, Simd(), lanes_i); +- alignas(16) double lanes_d[2]; +- for (size_t i = 0; i < N; ++i) { +- lanes_d[i] = static_cast(lanes_i[i]); +- } +- return Load(dd, lanes_d); ++ // Based on wim's approach (https://stackoverflow.com/questions/41144668/) ++ const Repartition d32; ++ const Repartition d64; ++ ++ // Toggle MSB of lower 32-bits and insert exponent for 2^84 + 2^63 ++ const auto k84_63 = Set(d64, 0x4530000080000000ULL); ++ const auto v_upper = BitCast(dd, ShiftRight<32>(BitCast(d64, v)) ^ k84_63); ++ ++ // Exponent is 2^52, lower 32 bits from v (=> 32-bit OddEven) ++ const auto k52 = Set(d32, 0x43300000); ++ const auto v_lower = BitCast(dd, OddEven(k52, BitCast(d32, v))); ++ ++ const auto k84_63_52 = BitCast(dd, Set(d64, 0x4530000080100000ULL)); ++ return (v_upper - k84_63_52) + v_lower; // order matters! + #endif + } + +@@ -3572,55 +3607,87 @@ HWY_API void StoreInterleaved4(const Vec + + namespace detail { + +-// For u32/i32/f32. +-template +-HWY_API Vec128 SumOfLanes(hwy::SizeTag<4> /* tag */, +- const Vec128 v3210) { ++// N=1 for any T: no-op ++template ++HWY_API Vec128 SumOfLanes(hwy::SizeTag /* tag */, ++ const Vec128 v) { ++ return v; ++} ++template ++HWY_API Vec128 MinOfLanes(hwy::SizeTag /* tag */, ++ const Vec128 v) { ++ return v; ++} ++template ++HWY_API Vec128 MaxOfLanes(hwy::SizeTag /* tag */, ++ const Vec128 v) { ++ return v; ++} ++ ++// u32/i32/f32: ++ ++// N=2 ++template ++HWY_API Vec128 SumOfLanes(hwy::SizeTag<4> /* tag */, ++ const Vec128 v10) { ++ return v10 + Vec128{Shuffle2301(Vec128{v10.raw}).raw}; ++} ++template ++HWY_API Vec128 MinOfLanes(hwy::SizeTag<4> /* tag */, ++ const Vec128 v10) { ++ return Min(v10, Vec128{Shuffle2301(Vec128{v10.raw}).raw}); ++} ++template ++HWY_API Vec128 MaxOfLanes(hwy::SizeTag<4> /* tag */, ++ const Vec128 v10) { ++ return Max(v10, Vec128{Shuffle2301(Vec128{v10.raw}).raw}); ++} ++ ++// N=4 (full) ++template ++HWY_API Vec128 SumOfLanes(hwy::SizeTag<4> /* tag */, const Vec128 v3210) { + const Vec128 v1032 = Shuffle1032(v3210); + const Vec128 v31_20_31_20 = v3210 + v1032; + const Vec128 v20_31_20_31 = Shuffle0321(v31_20_31_20); + return v20_31_20_31 + v31_20_31_20; + } +-template +-HWY_API Vec128 MinOfLanes(hwy::SizeTag<4> /* tag */, +- const Vec128 v3210) { ++template ++HWY_API Vec128 MinOfLanes(hwy::SizeTag<4> /* tag */, const Vec128 v3210) { + const Vec128 v1032 = Shuffle1032(v3210); + const Vec128 v31_20_31_20 = Min(v3210, v1032); + const Vec128 v20_31_20_31 = Shuffle0321(v31_20_31_20); + return Min(v20_31_20_31, v31_20_31_20); + } +-template +-HWY_API Vec128 MaxOfLanes(hwy::SizeTag<4> /* tag */, +- const Vec128 v3210) { ++template ++HWY_API Vec128 MaxOfLanes(hwy::SizeTag<4> /* tag */, const Vec128 v3210) { + const Vec128 v1032 = Shuffle1032(v3210); + const Vec128 v31_20_31_20 = Max(v3210, v1032); + const Vec128 v20_31_20_31 = Shuffle0321(v31_20_31_20); + return Max(v20_31_20_31, v31_20_31_20); + } + +-// For u64/i64/f64. +-template +-HWY_API Vec128 SumOfLanes(hwy::SizeTag<8> /* tag */, +- const Vec128 v10) { ++// u64/i64/f64: ++ ++// N=2 (full) ++template ++HWY_API Vec128 SumOfLanes(hwy::SizeTag<8> /* tag */, const Vec128 v10) { + const Vec128 v01 = Shuffle01(v10); + return v10 + v01; + } +-template +-HWY_API Vec128 MinOfLanes(hwy::SizeTag<8> /* tag */, +- const Vec128 v10) { ++template ++HWY_API Vec128 MinOfLanes(hwy::SizeTag<8> /* tag */, const Vec128 v10) { + const Vec128 v01 = Shuffle01(v10); + return Min(v10, v01); + } +-template +-HWY_API Vec128 MaxOfLanes(hwy::SizeTag<8> /* tag */, +- const Vec128 v10) { ++template ++HWY_API Vec128 MaxOfLanes(hwy::SizeTag<8> /* tag */, const Vec128 v10) { + const Vec128 v01 = Shuffle01(v10); + return Max(v10, v01); + } + + } // namespace detail + +-// Supported for u/i/f 32/64. Returns the sum in each lane. ++// Supported for u/i/f 32/64. Returns the same value in each lane. + template + HWY_API Vec128 SumOfLanes(const Vec128 v) { + return detail::SumOfLanes(hwy::SizeTag(), v); +diff -up chromium-92.0.4515.107/third_party/highway/src/hwy/ops/x86_256-inl.h.update-highway-0.12.2 chromium-92.0.4515.107/third_party/highway/src/hwy/ops/x86_256-inl.h +--- chromium-92.0.4515.107/third_party/highway/src/hwy/ops/x86_256-inl.h.update-highway-0.12.2 2021-07-19 14:47:23.000000000 -0400 ++++ chromium-92.0.4515.107/third_party/highway/src/hwy/ops/x86_256-inl.h 2021-07-26 17:19:30.740403369 -0400 +@@ -20,15 +20,18 @@ + // particular, "Broadcast", pack and zip behavior may be surprising. + + #include // AVX2+ ++ + #if defined(_MSC_VER) && defined(__clang__) + // Including should be enough, but Clang's headers helpfully skip + // including these headers when _MSC_VER is defined, like when using clang-cl. + // Include these directly here. +-#include + #include ++// avxintrin defines __m256i and must come before avx2intrin. + #include ++#include // _pext_u64 + #include + #include ++#include + #endif + + #include +@@ -159,23 +162,24 @@ HWY_API Vec256 Set(Full256{_mm256_set1_epi16(static_cast(t))}; // NOLINT + } + HWY_API Vec256 Set(Full256 /* tag */, const uint32_t t) { +- return Vec256{_mm256_set1_epi32(static_cast(t))}; // NOLINT ++ return Vec256{_mm256_set1_epi32(static_cast(t))}; + } + HWY_API Vec256 Set(Full256 /* tag */, const uint64_t t) { + return Vec256{ + _mm256_set1_epi64x(static_cast(t))}; // NOLINT + } + HWY_API Vec256 Set(Full256 /* tag */, const int8_t t) { +- return Vec256{_mm256_set1_epi8(t)}; ++ return Vec256{_mm256_set1_epi8(static_cast(t))}; // NOLINT + } + HWY_API Vec256 Set(Full256 /* tag */, const int16_t t) { +- return Vec256{_mm256_set1_epi16(t)}; ++ return Vec256{_mm256_set1_epi16(static_cast(t))}; // NOLINT + } + HWY_API Vec256 Set(Full256 /* tag */, const int32_t t) { + return Vec256{_mm256_set1_epi32(t)}; + } + HWY_API Vec256 Set(Full256 /* tag */, const int64_t t) { +- return Vec256{_mm256_set1_epi64x(t)}; ++ return Vec256{ ++ _mm256_set1_epi64x(static_cast(t))}; // NOLINT + } + HWY_API Vec256 Set(Full256 /* tag */, const float t) { + return Vec256{_mm256_set1_ps(t)}; +@@ -351,6 +355,8 @@ HWY_API Vec256 VecFromMask(Full256 + return Vec256{v.raw}; + } + ++// ------------------------------ IfThenElse ++ + // mask ? yes : no + template + HWY_API Vec256 IfThenElse(const Mask256 mask, const Vec256 yes, +@@ -681,6 +687,14 @@ HWY_API Vec256 Max(const Vec256< + return Vec256{_mm256_max_pd(a.raw, b.raw)}; + } + ++// ------------------------------ FirstN (Iota, Lt) ++ ++template ++HWY_API Mask256 FirstN(const Full256 d, size_t n) { ++ const RebindToSigned di; // Signed comparisons are cheaper. ++ return RebindMask(d, Iota(di, 0) < Set(di, static_cast>(n))); ++} ++ + // ================================================== ARITHMETIC + + // ------------------------------ Addition +@@ -843,7 +857,13 @@ HWY_API Vec256 AverageRound(co + + // Returns absolute value, except that LimitsMin() maps to LimitsMax() + 1. + HWY_API Vec256 Abs(const Vec256 v) { ++#if HWY_COMPILER_MSVC ++ // Workaround for incorrect codegen? (wrong result) ++ const auto zero = Zero(Full256()); ++ return Vec256{_mm256_max_epi8(v.raw, (zero - v).raw)}; ++#else + return Vec256{_mm256_abs_epi8(v.raw)}; ++#endif + } + HWY_API Vec256 Abs(const Vec256 v) { + return Vec256{_mm256_abs_epi16(v.raw)}; +@@ -851,6 +871,7 @@ HWY_API Vec256 Abs(const Vec256 + HWY_API Vec256 Abs(const Vec256 v) { + return Vec256{_mm256_abs_epi32(v.raw)}; + } ++// i64 is implemented after BroadcastSignBit. + + HWY_API Vec256 Abs(const Vec256 v) { + const Vec256 mask{_mm256_set1_epi32(0x7FFFFFFF)}; +@@ -1027,6 +1048,15 @@ HWY_API Vec256 ShiftRight(const + #endif + } + ++HWY_API Vec256 Abs(const Vec256 v) { ++#if HWY_TARGET == HWY_AVX3 ++ return Vec256{_mm256_abs_epi64(v.raw)}; ++#else ++ const auto zero = Zero(Full256()); ++ return IfThenElse(MaskFromVec(BroadcastSignBit(v)), zero - v, v); ++#endif ++} ++ + // ------------------------------ ShiftLeftSame + + HWY_API Vec256 ShiftLeftSame(const Vec256 v, +@@ -1398,6 +1428,10 @@ HWY_API void Stream(const Vec256 + + // ------------------------------ Scatter + ++// Work around warnings in the intrinsic definitions (passing -1 as a mask). ++HWY_DIAGNOSTICS(push) ++HWY_DIAGNOSTICS_OFF(disable : 4245 4365, ignored "-Wsign-conversion") ++ + #if HWY_TARGET == HWY_AVX3 + namespace detail { + +@@ -1584,6 +1618,8 @@ HWY_INLINE Vec256 GatherIndex{_mm256_i64gather_pd(base, index.raw, 8)}; + } + ++HWY_DIAGNOSTICS(pop) ++ + // ================================================== SWIZZLE + + template +@@ -2379,11 +2415,18 @@ HWY_API Vec128 DemoteTo(Full128< + _mm256_castsi256_si128(_mm256_permute4x64_epi64(i8, 0x88))}; + } + ++ // Avoid "value of intrinsic immediate argument '8' is out of range '0 - 7'". ++ // 8 is the correct value of _MM_FROUND_NO_EXC, which is allowed here. ++HWY_DIAGNOSTICS(push) ++HWY_DIAGNOSTICS_OFF(disable : 4556, ignored "-Wsign-conversion") ++ + HWY_API Vec128 DemoteTo(Full128 /* tag */, + const Vec256 v) { + return Vec128{_mm256_cvtps_ph(v.raw, _MM_FROUND_NO_EXC)}; + } + ++HWY_DIAGNOSTICS(pop) ++ + HWY_API Vec128 DemoteTo(Full128 /* tag */, + const Vec256 v) { + return Vec128{_mm256_cvtpd_ps(v.raw)}; +@@ -2409,7 +2452,7 @@ HWY_API Vec128 U8FromU32(con + return BitCast(Simd(), pair); + } + +-// ------------------------------ Convert integer <=> floating point ++// ------------------------------ Integer <=> fp (ShiftRight, OddEven) + + HWY_API Vec256 ConvertTo(Full256 /* tag */, + const Vec256 v) { +@@ -2421,13 +2464,20 @@ HWY_API Vec256 ConvertTo(Full256 + (void)dd; + return Vec256{_mm256_cvtepi64_pd(v.raw)}; + #else +- alignas(32) int64_t lanes_i[4]; +- Store(v, Full256(), lanes_i); +- alignas(32) double lanes_d[4]; +- for (size_t i = 0; i < 4; ++i) { +- lanes_d[i] = static_cast(lanes_i[i]); +- } +- return Load(dd, lanes_d); ++ // Based on wim's approach (https://stackoverflow.com/questions/41144668/) ++ const Repartition d32; ++ const Repartition d64; ++ ++ // Toggle MSB of lower 32-bits and insert exponent for 2^84 + 2^63 ++ const auto k84_63 = Set(d64, 0x4530000080000000ULL); ++ const auto v_upper = BitCast(dd, ShiftRight<32>(BitCast(d64, v)) ^ k84_63); ++ ++ // Exponent is 2^52, lower 32 bits from v (=> 32-bit OddEven) ++ const auto k52 = Set(d32, 0x43300000); ++ const auto v_lower = BitCast(dd, OddEven(k52, BitCast(d32, v))); ++ ++ const auto k84_63_52 = BitCast(dd, Set(d64, 0x4530000080100000ULL)); ++ return (v_upper - k84_63_52) + v_lower; // order matters! + #endif + } + +@@ -2502,8 +2552,7 @@ HWY_API uint64_t BitsFromMask(hwy::SizeT + const auto compressed = + _mm256_permute4x64_epi64(sign_bits, _MM_SHUFFLE(3, 1, 2, 0)); + return static_cast(_mm256_movemask_epi8(compressed)); +- +-#endif ++#endif // HWY_ARCH_X86_64 + } + + template +diff -up chromium-92.0.4515.107/third_party/highway/src/hwy/targets.cc.update-highway-0.12.2 chromium-92.0.4515.107/third_party/highway/src/hwy/targets.cc +--- chromium-92.0.4515.107/third_party/highway/src/hwy/targets.cc.update-highway-0.12.2 2021-07-19 14:47:23.000000000 -0400 ++++ chromium-92.0.4515.107/third_party/highway/src/hwy/targets.cc 2021-07-26 17:17:24.610482240 -0400 +@@ -32,8 +32,8 @@ + #include + #else // HWY_COMPILER_MSVC + #include +-#endif // HWY_COMPILER_MSVC +-#endif ++#endif // HWY_COMPILER_MSVC ++#endif // HWY_ARCH_X86 + + namespace hwy { + namespace { +@@ -126,7 +126,7 @@ constexpr uint32_t kAVX512VL = 1u << 13; + constexpr uint32_t kAVX512DQ = 1u << 14; + constexpr uint32_t kAVX512BW = 1u << 15; + constexpr uint32_t kGroupAVX3 = kAVX512F | kAVX512VL | kAVX512DQ | kAVX512BW; +-#endif ++#endif // HWY_ARCH_X86 + + } // namespace + +diff -up chromium-92.0.4515.107/third_party/highway/src/hwy/targets.h.update-highway-0.12.2 chromium-92.0.4515.107/third_party/highway/src/hwy/targets.h +--- chromium-92.0.4515.107/third_party/highway/src/hwy/targets.h.update-highway-0.12.2 2021-07-19 14:47:23.000000000 -0400 ++++ chromium-92.0.4515.107/third_party/highway/src/hwy/targets.h 2021-07-26 17:17:24.610482240 -0400 +@@ -65,7 +65,9 @@ + // HWY_MAX_DYNAMIC_TARGETS in total. + #define HWY_HIGHEST_TARGET_BIT_X86 9 + +-// 0x400, 0x800, 0x1000 reserved for SVE, SVE2, Helium ++#define HWY_SVE2 0x400 ++#define HWY_SVE 0x800 ++// 0x1000 reserved for Helium + #define HWY_NEON 0x2000 + + #define HWY_HIGHEST_TARGET_BIT_ARM 13 +@@ -90,6 +92,9 @@ + // 0x2000000, 0x4000000, 0x8000000, 0x10000000 reserved + + #define HWY_SCALAR 0x20000000 ++ ++#define HWY_HIGHEST_TARGET_BIT_SCALAR 29 ++ + // Cannot use higher values, otherwise HWY_TARGETS computation might overflow. + + //------------------------------------------------------------------------------ +@@ -106,25 +111,26 @@ + #ifndef HWY_BROKEN_TARGETS + + // x86 clang-6: we saw multiple AVX2/3 compile errors and in one case invalid +-// SSE4 codegen (msan failure), so disable all those targets. ++// SSE4 codegen (possibly only for msan), so disable all those targets. + #if HWY_ARCH_X86 && (HWY_COMPILER_CLANG != 0 && HWY_COMPILER_CLANG < 700) +-// TODO: Disable all non-scalar targets for every build target once we have +-// clang-7 enabled in our builders. +-#ifdef MEMORY_SANITIZER + #define HWY_BROKEN_TARGETS (HWY_SSE4 | HWY_AVX2 | HWY_AVX3) +-#else +-#define HWY_BROKEN_TARGETS 0 +-#endif + // This entails a major speed reduction, so warn unless the user explicitly + // opts in to scalar-only. + #if !defined(HWY_COMPILE_ONLY_SCALAR) + #pragma message("x86 Clang <= 6: define HWY_COMPILE_ONLY_SCALAR or upgrade.") + #endif + +-// MSVC, or 32-bit may fail to compile AVX2/3. +-#elif HWY_COMPILER_MSVC != 0 || HWY_ARCH_X86_32 ++// 32-bit may fail to compile AVX2/3. ++#elif HWY_ARCH_X86_32 + #define HWY_BROKEN_TARGETS (HWY_AVX2 | HWY_AVX3) +-#pragma message("Disabling AVX2/3 due to known issues with MSVC/32-bit builds") ++ ++// MSVC AVX3 support is buggy: https://github.com/Mysticial/Flops/issues/16 ++#elif HWY_COMPILER_MSVC != 0 ++#define HWY_BROKEN_TARGETS (HWY_AVX3) ++ ++// armv7be has not been tested and is not yet supported. ++#elif HWY_ARCH_ARM_V7 && (defined(__ARM_BIG_ENDIAN) || defined(__BIG_ENDIAN)) ++#define HWY_BROKEN_TARGETS (HWY_NEON) + + #else + #define HWY_BROKEN_TARGETS 0 +@@ -145,53 +151,74 @@ + // user to override this without any guarantee of success. + #ifndef HWY_BASELINE_TARGETS + +-#ifdef __wasm_simd128__ ++// Also check HWY_ARCH to ensure that simulating unknown platforms ends up with ++// HWY_TARGET == HWY_SCALAR. ++ ++#if HWY_ARCH_WASM && defined(__wasm_simd128__) + #define HWY_BASELINE_WASM HWY_WASM + #else + #define HWY_BASELINE_WASM 0 + #endif + +-#ifdef __VSX__ ++// Avoid choosing the PPC target until we have an implementation. ++#if HWY_ARCH_PPC && defined(__VSX__) && 0 + #define HWY_BASELINE_PPC8 HWY_PPC8 + #else + #define HWY_BASELINE_PPC8 0 + #endif + +-// GCC 4.5.4 only defines the former; 5.4 defines both. +-#if defined(__ARM_NEON__) || defined(__ARM_NEON) ++// Avoid choosing the SVE[2] targets the implementation is ready. ++#if HWY_ARCH_ARM && defined(__ARM_FEATURE_SVE2) && 0 ++#define HWY_BASELINE_SVE2 HWY_SVE2 ++#else ++#define HWY_BASELINE_SVE2 0 ++#endif ++ ++#if HWY_ARCH_ARM && defined(__ARM_FEATURE_SVE) && 0 ++#define HWY_BASELINE_SVE HWY_SVE ++#else ++#define HWY_BASELINE_SVE 0 ++#endif ++ ++// GCC 4.5.4 only defines __ARM_NEON__; 5.4 defines both. ++#if HWY_ARCH_ARM && (defined(__ARM_NEON__) || defined(__ARM_NEON)) + #define HWY_BASELINE_NEON HWY_NEON + #else + #define HWY_BASELINE_NEON 0 + #endif + +-#ifdef __SSE4_1__ ++// MSVC does not set SSE4_1, but it does set AVX; checking for the latter means ++// we at least get SSE4 on machines supporting AVX but not AVX2. ++// https://stackoverflow.com/questions/18563978/ ++#if HWY_ARCH_X86 && \ ++ (defined(__SSE4_1__) || (HWY_COMPILER_MSVC != 0 && defined(__AVX__))) + #define HWY_BASELINE_SSE4 HWY_SSE4 + #else + #define HWY_BASELINE_SSE4 0 + #endif + +-#ifdef __AVX2__ ++#if HWY_ARCH_X86 && defined(__AVX2__) + #define HWY_BASELINE_AVX2 HWY_AVX2 + #else + #define HWY_BASELINE_AVX2 0 + #endif + +-#ifdef __AVX512F__ ++#if HWY_ARCH_X86 && defined(__AVX512F__) + #define HWY_BASELINE_AVX3 HWY_AVX3 + #else + #define HWY_BASELINE_AVX3 0 + #endif + +-#ifdef __riscv_vector ++#if HWY_ARCH_RVV && defined(__riscv_vector) + #define HWY_BASELINE_RVV HWY_RVV + #else + #define HWY_BASELINE_RVV 0 + #endif + + #define HWY_BASELINE_TARGETS \ +- (HWY_SCALAR | HWY_BASELINE_WASM | HWY_BASELINE_PPC8 | HWY_BASELINE_NEON | \ +- HWY_BASELINE_SSE4 | HWY_BASELINE_AVX2 | HWY_BASELINE_AVX3 | \ +- HWY_BASELINE_RVV) ++ (HWY_SCALAR | HWY_BASELINE_WASM | HWY_BASELINE_PPC8 | HWY_BASELINE_SVE2 | \ ++ HWY_BASELINE_SVE | HWY_BASELINE_NEON | HWY_BASELINE_SSE4 | \ ++ HWY_BASELINE_AVX2 | HWY_BASELINE_AVX3 | HWY_BASELINE_RVV) + + #endif // HWY_BASELINE_TARGETS + +@@ -242,13 +269,12 @@ + #define HWY_TARGETS HWY_STATIC_TARGET + + // 3) For tests: include all attainable targets (in particular: scalar) +-#elif defined(HWY_COMPILE_ALL_ATTAINABLE) ++#elif defined(HWY_COMPILE_ALL_ATTAINABLE) || defined(HWY_IS_TEST) + #define HWY_TARGETS HWY_ATTAINABLE_TARGETS + + // 4) Default: attainable WITHOUT non-best baseline. This reduces code size by + // excluding superseded targets, in particular scalar. + #else +- + #define HWY_TARGETS (HWY_ATTAINABLE_TARGETS & (2 * HWY_STATIC_TARGET - 1)) + + #endif // target policy +@@ -323,6 +349,10 @@ static inline HWY_MAYBE_UNUSED const cha + #endif + + #if HWY_ARCH_ARM ++ case HWY_SVE2: ++ return "SVE2"; ++ case HWY_SVE: ++ return "SVE"; + case HWY_NEON: + return "Neon"; + #endif +@@ -346,7 +376,7 @@ static inline HWY_MAYBE_UNUSED const cha + return "Scalar"; + + default: +- return "?"; ++ return "Unknown"; // must satisfy gtest IsValidParamName() + } + } + +@@ -405,21 +435,17 @@ static inline HWY_MAYBE_UNUSED const cha + nullptr, /* SSE3 */ \ + nullptr /* SSE2 */ + +-#endif // HWY_ARCH_X86 +- +-#if HWY_ARCH_ARM ++#elif HWY_ARCH_ARM + // See HWY_ARCH_X86 above for details. + #define HWY_MAX_DYNAMIC_TARGETS 4 + #define HWY_HIGHEST_TARGET_BIT HWY_HIGHEST_TARGET_BIT_ARM + #define HWY_CHOOSE_TARGET_LIST(func_name) \ +- nullptr, /* reserved */ \ +- nullptr, /* reserved */ \ ++ HWY_CHOOSE_SVE2(func_name), /* SVE2 */ \ ++ HWY_CHOOSE_SVE(func_name), /* SVE */ \ + nullptr, /* reserved */ \ + HWY_CHOOSE_NEON(func_name) /* NEON */ + +-#endif // HWY_ARCH_ARM +- +-#if HWY_ARCH_PPC ++#elif HWY_ARCH_PPC + // See HWY_ARCH_X86 above for details. + #define HWY_MAX_DYNAMIC_TARGETS 5 + #define HWY_HIGHEST_TARGET_BIT HWY_HIGHEST_TARGET_BIT_PPC +@@ -430,9 +456,7 @@ static inline HWY_MAYBE_UNUSED const cha + nullptr, /* VSX */ \ + nullptr /* AltiVec */ + +-#endif // HWY_ARCH_PPC +- +-#if HWY_ARCH_WASM ++#elif HWY_ARCH_WASM + // See HWY_ARCH_X86 above for details. + #define HWY_MAX_DYNAMIC_TARGETS 4 + #define HWY_HIGHEST_TARGET_BIT HWY_HIGHEST_TARGET_BIT_WASM +@@ -442,9 +466,7 @@ static inline HWY_MAYBE_UNUSED const cha + nullptr, /* reserved */ \ + HWY_CHOOSE_WASM(func_name) /* WASM */ + +-#endif // HWY_ARCH_WASM +- +-#if HWY_ARCH_RVV ++#elif HWY_ARCH_RVV + // See HWY_ARCH_X86 above for details. + #define HWY_MAX_DYNAMIC_TARGETS 4 + #define HWY_HIGHEST_TARGET_BIT HWY_HIGHEST_TARGET_BIT_RVV +@@ -454,7 +476,12 @@ static inline HWY_MAYBE_UNUSED const cha + nullptr, /* reserved */ \ + HWY_CHOOSE_RVV(func_name) /* RVV */ + +-#endif // HWY_ARCH_RVV ++#else ++// Unknown architecture, will use HWY_SCALAR without dynamic dispatch, though ++// still creating single-entry tables in HWY_EXPORT to ensure portability. ++#define HWY_MAX_DYNAMIC_TARGETS 1 ++#define HWY_HIGHEST_TARGET_BIT HWY_HIGHEST_TARGET_BIT_SCALAR ++#endif + + struct ChosenTarget { + public: +diff -up chromium-92.0.4515.107/third_party/highway/src/hwy/tests/memory_test.cc.update-highway-0.12.2 chromium-92.0.4515.107/third_party/highway/src/hwy/tests/memory_test.cc +--- chromium-92.0.4515.107/third_party/highway/src/hwy/tests/memory_test.cc.update-highway-0.12.2 2021-07-19 14:47:23.000000000 -0400 ++++ chromium-92.0.4515.107/third_party/highway/src/hwy/tests/memory_test.cc 2021-07-26 17:10:40.022319820 -0400 +@@ -12,6 +12,12 @@ + // See the License for the specific language governing permissions and + // limitations under the License. + ++// Ensure incompabilities with Windows macros (e.g. #define StoreFence) are ++// detected. Must come before Highway headers. ++#if defined(_WIN32) || defined(_WIN64) ++#include ++#endif ++ + #include + #include + +@@ -199,13 +205,14 @@ struct TestLoadDup128 { + for (size_t i = 0; i < N128; ++i) { + lanes[i] = static_cast(1 + i); + } +- const auto v = LoadDup128(d, lanes); ++ + const size_t N = Lanes(d); +- auto out = AllocateAligned(N); +- Store(v, d, out.get()); ++ auto expected = AllocateAligned(N); + for (size_t i = 0; i < N; ++i) { +- HWY_ASSERT_EQ(T(i % N128 + 1), out[i]); ++ expected[i] = static_cast(i % N128 + 1); + } ++ ++ HWY_ASSERT_VEC_EQ(d, expected.get(), LoadDup128(d, lanes)); + #else + (void)d; + #endif +@@ -327,6 +334,84 @@ HWY_NOINLINE void TestAllScatter() { + ForFloatTypes(test); + } + ++// Assumes little-endian byte order! ++struct TestScatter { ++ template ++ HWY_NOINLINE void operator()(T /*unused*/, D d) { ++ using Offset = MakeSigned; ++ ++ const size_t N = Lanes(d); ++ const size_t range = 4 * N; // number of items to scatter ++ const size_t max_bytes = range * sizeof(T); // upper bound on offset ++ ++ RandomState rng; ++ ++ // Data to be scattered ++ auto bytes = AllocateAligned(max_bytes); ++ for (size_t i = 0; i < max_bytes; ++i) { ++ bytes[i] = static_cast(Random32(&rng) & 0xFF); ++ } ++ const auto data = Load(d, reinterpret_cast(bytes.get())); ++ ++ // Scatter into these regions, ensure vector results match scalar ++ auto expected = AllocateAligned(range); ++ auto actual = AllocateAligned(range); ++ ++ const Rebind d_offsets; ++ auto offsets = AllocateAligned(N); // or indices ++ ++ for (size_t rep = 0; rep < 100; ++rep) { ++ // Byte offsets ++ std::fill(expected.get(), expected.get() + range, T(0)); ++ std::fill(actual.get(), actual.get() + range, T(0)); ++ for (size_t i = 0; i < N; ++i) { ++ offsets[i] = ++ static_cast(Random32(&rng) % (max_bytes - sizeof(T))); ++ CopyBytes( ++ bytes.get() + i * sizeof(T), ++ reinterpret_cast(expected.get()) + offsets[i]); ++ } ++ const auto voffsets = Load(d_offsets, offsets.get()); ++ ScatterOffset(data, d, actual.get(), voffsets); ++ if (!BytesEqual(expected.get(), actual.get(), max_bytes)) { ++ Print(d, "Data", data); ++ Print(d_offsets, "Offsets", voffsets); ++ HWY_ASSERT(false); ++ } ++ ++ // Indices ++ std::fill(expected.get(), expected.get() + range, T(0)); ++ std::fill(actual.get(), actual.get() + range, T(0)); ++ for (size_t i = 0; i < N; ++i) { ++ offsets[i] = static_cast(Random32(&rng) % range); ++ CopyBytes(bytes.get() + i * sizeof(T), ++ &expected[offsets[i]]); ++ } ++ const auto vindices = Load(d_offsets, offsets.get()); ++ ScatterIndex(data, d, actual.get(), vindices); ++ if (!BytesEqual(expected.get(), actual.get(), max_bytes)) { ++ Print(d, "Data", data); ++ Print(d_offsets, "Indices", vindices); ++ HWY_ASSERT(false); ++ } ++ } ++ } ++}; ++ ++HWY_NOINLINE void TestAllScatter() { ++ // No u8,u16,i8,i16. ++ const ForPartialVectors test; ++ test(uint32_t()); ++ test(int32_t()); ++ ++#if HWY_CAP_INTEGER64 ++ test(uint64_t()); ++ test(int64_t()); ++#endif ++ ++ ForFloatTypes(test); ++} ++ + struct TestGather { + template + HWY_NOINLINE void operator()(T /*unused*/, D d) { +@@ -391,6 +476,7 @@ HWY_NOINLINE void TestAllCache() { + int test = 0; + Prefetch(&test); + FlushCacheline(&test); ++ Pause(); + } + + // NOLINTNEXTLINE(google-readability-namespace-comments) +diff -up chromium-92.0.4515.107/third_party/highway/src/hwy/tests/swizzle_test.cc.update-highway-0.12.2 chromium-92.0.4515.107/third_party/highway/src/hwy/tests/swizzle_test.cc +--- chromium-92.0.4515.107/third_party/highway/src/hwy/tests/swizzle_test.cc.update-highway-0.12.2 2021-07-19 14:47:23.000000000 -0400 ++++ chromium-92.0.4515.107/third_party/highway/src/hwy/tests/swizzle_test.cc 2021-07-26 17:10:40.023319835 -0400 +@@ -223,6 +223,7 @@ struct TestTableLookupBytes { + HWY_NOINLINE void TestAllTableLookupBytes() { + ForIntegerTypes(ForPartialVectors()); + } ++ + struct TestTableLookupLanes { + #if HWY_TARGET == HWY_RVV + using Index = uint32_t; +@@ -242,12 +243,13 @@ struct TestTableLookupLanes { + if (N <= 8) { // Test all permutations + for (size_t i0 = 0; i0 < N; ++i0) { + idx[0] = static_cast(i0); ++ + for (size_t i1 = 0; i1 < N; ++i1) { +- idx[1] = static_cast(i1); ++ if (N >= 2) idx[1] = static_cast(i1); + for (size_t i2 = 0; i2 < N; ++i2) { +- idx[2] = static_cast(i2); ++ if (N >= 4) idx[2] = static_cast(i2); + for (size_t i3 = 0; i3 < N; ++i3) { +- idx[3] = static_cast(i3); ++ if (N >= 4) idx[3] = static_cast(i3); + + for (size_t i = 0; i < N; ++i) { + expected[i] = static_cast(idx[i] + 1); // == v[idx[i]] +@@ -286,7 +288,7 @@ struct TestTableLookupLanes { + }; + + HWY_NOINLINE void TestAllTableLookupLanes() { +- const ForFullVectors test; ++ const ForPartialVectors test; + test(uint32_t()); + test(int32_t()); + test(float()); +diff -up chromium-92.0.4515.107/third_party/highway/src/README.md.update-highway-0.12.2 chromium-92.0.4515.107/third_party/highway/src/README.md +--- chromium-92.0.4515.107/third_party/highway/src/README.md.update-highway-0.12.2 2021-07-26 17:10:40.838332249 -0400 ++++ chromium-92.0.4515.107/third_party/highway/src/README.md 2021-07-26 17:15:00.832292309 -0400 +@@ -15,7 +15,7 @@ applying the same operation to 'lanes'. + ## Current status + + Supported targets: scalar, SSE4, AVX2, AVX-512, NEON (ARMv7 and v8), WASM SIMD. +-A port to RVV is in progress. ++Ports to RVV and SVE/SVE2 are in progress. + + Version 0.11 is considered stable enough to use in other projects, and is + expected to remain backwards compatible unless serious issues are discovered +@@ -23,8 +23,11 @@ while implementing SVE/RVV targets. Afte + reach version 1.0. + + Continuous integration tests build with a recent version of Clang (running on +-x86 and QEMU for ARM) and MSVC from VS2015 (running on x86). Also periodically +-tested on x86 with Clang 7-11 and GCC 8, 9 and 10.2.1. ++x86 and QEMU for ARM) and MSVC from VS2015 (running on x86). ++ ++Before releases, we also test on x86 with Clang and GCC, and ARMv7/8 via ++GCC cross-compile and QEMU. See the ++[testing process](g3doc/release_testing_process.md) for details. + + The `contrib` directory contains SIMD-related utilities: an image class with + aligned rows, and a math library (16 functions already implemented, mostly +@@ -63,6 +66,8 @@ To test on all the attainable targets fo + default configuration skips baseline targets (e.g. scalar) that are superseded + by another baseline target. + ++Bazel is also supported for building, but it is not as widely used/tested. ++ + ## Quick start + + You can use the `benchmark` inside examples/ as a starting point. +diff -up chromium-92.0.4515.107/third_party/highway/src/run_tests.bat.update-highway-0.12.2 chromium-92.0.4515.107/third_party/highway/src/run_tests.bat +--- chromium-92.0.4515.107/third_party/highway/src/run_tests.bat.update-highway-0.12.2 2021-07-19 14:47:23.000000000 -0400 ++++ chromium-92.0.4515.107/third_party/highway/src/run_tests.bat 2021-07-26 17:14:47.466088723 -0400 +@@ -2,9 +2,9 @@ + REM Switch directory of this batch file + cd %~dp0 + +-if not exist build mkdir build ++if not exist build_win mkdir build_win + +-cd build ++cd build_win + cmake .. -G Ninja || goto error + ninja || goto error + ctest -j || goto error diff --git a/chromium-92.0.4515.107-widevine-other-locations.patch b/chromium-92.0.4515.107-widevine-other-locations.patch new file mode 100644 index 0000000..739778d --- /dev/null +++ b/chromium-92.0.4515.107-widevine-other-locations.patch @@ -0,0 +1,20 @@ +diff -up chromium-92.0.4515.107/chrome/common/chrome_paths.cc.widevine-other-locations chromium-92.0.4515.107/chrome/common/chrome_paths.cc +--- chromium-92.0.4515.107/chrome/common/chrome_paths.cc.widevine-other-locations 2021-07-26 16:50:41.815065696 -0400 ++++ chromium-92.0.4515.107/chrome/common/chrome_paths.cc 2021-07-26 16:58:08.334868284 -0400 +@@ -313,6 +313,16 @@ bool PathProvider(int key, base::FilePat + + #if BUILDFLAG(ENABLE_WIDEVINE) + case chrome::DIR_BUNDLED_WIDEVINE_CDM: ++ base::PathService::Get(base::DIR_HOME, &cur); ++ cur = cur.Append(FILE_PATH_LITERAL(".local/lib/libwidevinecdm.so")); ++ if (base::PathExists(cur)) { ++ break; ++ } ++ // Yes, this has an arch hardcoded in the path, but at this time, it is the only place to find libwidevinecdm.so ++ if (base::PathExists(base::FilePath(FILE_PATH_LITERAL("/opt/google/chrome/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so")))) { ++ cur = base::FilePath(FILE_PATH_LITERAL("/opt/google/chrome/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so")); ++ break; ++ } + if (!GetComponentDirectory(&cur)) + return false; + #if !BUILDFLAG(IS_CHROMEOS_ASH) diff --git a/chromium.spec b/chromium.spec index 30e7be0..ffb2332 100644 --- a/chromium.spec +++ b/chromium.spec @@ -208,15 +208,15 @@ BuildRequires: libicu-devel >= 5.4 %global chromoting_client_id %nil %endif -%global majorversion 91 +%global majorversion 92 %if %{freeworld} Name: chromium%{chromium_channel}%{nsuffix} %else Name: chromium%{chromium_channel} %endif -Version: %{majorversion}.0.4472.164 -Release: 2%{?dist} +Version: %{majorversion}.0.4515.107 +Release: 1%{?dist} %if %{?freeworld} %if %{?shared} # chromium-libs-media-freeworld @@ -244,18 +244,18 @@ Patch4: chromium-60.0.3112.78-jpeg-nomangle.patch # Do not mangle zlib Patch5: chromium-77.0.3865.75-no-zlib-mangle.patch # Do not use unrar code, it is non-free -Patch6: chromium-89.0.4389.72-norar.patch +Patch6: chromium-92.0.4515.107-norar.patch # Use Gentoo's Widevine hack # https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/files/chromium-widevine-r3.patch Patch7: chromium-71.0.3578.98-widevine-r3.patch # Disable fontconfig cache magic that breaks remoting Patch8: chromium-91.0.4472.77-disable-fontconfig-cache-magic.patch # drop rsp clobber, which breaks gcc9 (thanks to Jeff Law) -Patch9: chromium-78.0.3904.70-gcc9-drop-rsp-clobber.patch +Patch9: chromium-78.0.3904.70-gcc9-drop-rsp-clobber.patch # Try to load widevine from other places -Patch10: chromium-89.0.4389.72-widevine-other-locations.patch +Patch10: chromium-92.0.4515.107-widevine-other-locations.patch # Try to fix version.py for Rawhide -Patch11: chromium-71.0.3578.98-py2-bootstrap.patch +Patch11: chromium-92.0.4515.107-py2-bootstrap.patch # Add "Fedora" to the user agent string Patch12: chromium-86.0.4240.75-fedora-user-agent.patch @@ -274,13 +274,11 @@ Patch57: chromium-89.0.4389.72-missing-cstring-header.patch # prepare for using system ffmpeg (clean) # http://svnweb.mageia.org/packages/cauldron/chromium-browser-stable/current/SOURCES/chromium-53-ffmpeg-no-deprecation-errors.patch?view=markup Patch58: chromium-53-ffmpeg-no-deprecation-errors.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-91-pcscan-vector-types.patch -Patch59: chromium-91-pcscan-vector-types.patch # https://github.com/stha09/chromium-patches/blob/master/chromium-91-libyuv-aarch64.patch Patch60: chromium-91-libyuv-aarch64.patch # Update third_party/highway to 0.12.2 # this is needed for sane arm/aarch64 -Patch61: chromium-91.0.4472.77-update-highway-0.12.2.patch +Patch61: chromium-92.0.4515.107-update-highway-0.12.2.patch # https://github.com/stha09/chromium-patches/blob/master/chromium-90-ruy-include.patch Patch62: chromium-90-ruy-include.patch # Extra CXXFLAGS for aarch64 @@ -290,7 +288,7 @@ Patch63: chromium-91.0.4472.77-aarch64-cxxflags-addition.patch Patch64: chromium-91.0.4472.77-java-only-allowed-in-android-builds.patch # Silence GCC warnings during gn compile -Patch65: chromium-84.0.4147.105-gn-gcc-cleanup.patch +Patch65: chromium-92.0.4515.107-gn-gcc-cleanup.patch # Fix missing cstring in remoting code Patch66: chromium-84.0.4147.125-remoting-cstring.patch # Apply fix_textrels hack for i686 (even without lld) @@ -301,16 +299,16 @@ Patch68: chromium-84.0.4147.125-aarch64-clearkeycdm-binutils-workaround.patch # Thanks to Kevin Kofler for the fix. Patch75: chromium-90.0.4430.72-fstatfix.patch # Rawhide (f35) glibc defines SIGSTKSZ as a long instead of a constant -Patch76: chromium-88.0.4324.182-rawhide-gcc-std-max-fix.patch +Patch76: chromium-92.0.4515.107-rawhide-gcc-std-max-fix.patch # Fix symbol visibility with gcc on swiftshader's libEGL Patch77: chromium-88.0.4324.182-gcc-fix-swiftshader-libEGL-visibility.patch # Do not download proprietary widevine module in the background (thanks Debian) Patch79: chromium-90.0.4430.72-widevine-no-download.patch # Fix crashes with components/cast_* # Thanks to Gentoo -Patch80: https://gitweb.gentoo.org/repo/gentoo.git/plain/www-client/chromium/files/chromium-89-EnumTable-crash.patch -# Fix crashes with ThemeService, thanks OpenSUSE -Patch81: chromium-91-1190561-boo1186948.patch +Patch80: chromium-92.0.4515.107-EnumTable-crash.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-92-v8-constexpr.patch +Patch82: chromium-92-v8-constexpr.patch # Use lstdc++ on EPEL7 only @@ -928,7 +926,6 @@ udev. %patch56 -p1 -b .missing-cstdint %patch57 -p1 -b .missing-cstring %patch58 -p1 -b .ffmpeg-deprecations -%patch59 -p1 -b .pcscan-vector-types %patch60 -p1 -b .libyuv-aarch64 %patch61 -p1 -b .update-highway-0.12.2 %patch62 -p1 -b .ruy-include @@ -945,7 +942,7 @@ udev. %patch77 -p1 -b .gcc-swiftshader-visibility %patch79 -p1 -b .widevine-no-download %patch80 -p1 -b .EnumTable-crash -%patch81 -p1 -b .ThemeService-crash +%patch82 -p1 -b .v8-constexpr # Fedora branded user agent %if 0%{?fedora} @@ -1222,7 +1219,6 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/devtools-frontend/src/front_end/third_party/axe-core' \ 'third_party/devtools-frontend/src/front_end/third_party/chromium' \ 'third_party/devtools-frontend/src/front_end/third_party/codemirror' \ - 'third_party/devtools-frontend/src/front_end/third_party/fabricjs' \ 'third_party/devtools-frontend/src/front_end/third_party/i18n' \ 'third_party/devtools-frontend/src/front_end/third_party/intl-messageformat' \ 'third_party/devtools-frontend/src/front_end/third_party/lighthouse' \ @@ -1375,7 +1371,6 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/tflite/src/third_party/eigen3' \ 'third_party/tflite/src/third_party/fft2d' \ 'third_party/tflite-support' \ - 'third_party/tint' \ 'third_party/ukey2' \ 'third_party/usb_ids' \ 'third_party/usrsctp' \ @@ -2010,6 +2005,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Mon Jul 26 2021 Tom Callaway - 92.0.4515.107-1 +- update to 92.0.4515.107 + * Wed Jul 21 2021 Fedora Release Engineering - 91.0.4472.164-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild diff --git a/sources b/sources index 2e8e02b..a18d2ac 100644 --- a/sources +++ b/sources @@ -20,4 +20,4 @@ SHA512 (xcb-proto-1.14.tar.xz) = de66d568163b6da2be9d6c59984f3afa3acd119a7813786 SHA512 (depot_tools.git-master.tar.gz) = dc323888812b66cc92c53a24a8a58ccf9e2961be67aa21852bd091b8b49569071f06ae9104cb58950e6253ac3a29f0db0663e9f35ef2b1ea28696efb38b42708 SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1dc09f5a0fd7898e9d0a372ee4422b6b1cdab3c86ecc91db437e9ae8a951e64e85edc3ac9e9fca428852dbb2ad SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a -SHA512 (chromium-91.0.4472.164-clean.tar.xz) = 71e3449e2042d83df50a7ea753e5b09bfc331640665f0d9b8d99a424b32a316a92c7bb2726ce51c5418936f423f2f7167fcfc57d51ca658e7e32347e8452efbc +SHA512 (chromium-92.0.4515.107-clean.tar.xz) = c0da154919e48970f1edde7cabeded907bcd1992c58924fefbfd891ad12aa06e3c643589d89b48d375de507bddf3d01d843a50a0b9376cadbb5a98a651e6d02a From 9fb24340a00416b57656080e6037bcecb303dd95 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Mon, 26 Jul 2021 22:38:53 -0400 Subject: [PATCH 014/659] epel8 --- ...hel8-force-disable-use_gnome_keyring.patch | 12 ++++++++++ chromium.spec | 2 +- sources | 23 ------------------- 3 files changed, 13 insertions(+), 24 deletions(-) create mode 100644 chromium-92.0.4515.107-rhel8-force-disable-use_gnome_keyring.patch delete mode 100644 sources diff --git a/chromium-92.0.4515.107-rhel8-force-disable-use_gnome_keyring.patch b/chromium-92.0.4515.107-rhel8-force-disable-use_gnome_keyring.patch new file mode 100644 index 0000000..9724c44 --- /dev/null +++ b/chromium-92.0.4515.107-rhel8-force-disable-use_gnome_keyring.patch @@ -0,0 +1,12 @@ +diff -up chromium-92.0.4515.107/components/os_crypt/features.gni.disblegnomekeyring chromium-92.0.4515.107/components/os_crypt/features.gni +--- chromium-92.0.4515.107/components/os_crypt/features.gni.disblegnomekeyring 2021-07-26 22:31:54.887207201 -0400 ++++ chromium-92.0.4515.107/components/os_crypt/features.gni 2021-07-26 22:35:00.879013268 -0400 +@@ -8,7 +8,7 @@ import("//build/config/ui.gni") + declare_args() { + # Whether to use libgnome-keyring (deprecated by libsecret). + # See http://crbug.com/466975 and http://crbug.com/355223. +- use_gnome_keyring = (is_linux || is_chromeos_lacros) && use_glib ++ use_gnome_keyring = false + + # Whether to make account and service names for the crypto key storage + # configurable at runtime for embedders. diff --git a/chromium.spec b/chromium.spec index ffb2332..067df18 100644 --- a/chromium.spec +++ b/chromium.spec @@ -345,7 +345,7 @@ Patch203: chromium-86.0.4240.75-vaapi-i686-fpermissive.patch Patch205: chromium-86.0.4240.75-fix-vaapi-on-intel.patch # Apply these patches to work around EPEL8 issues -Patch300: chromium-89.0.4389.82-rhel8-force-disable-use_gnome_keyring.patch +Patch300: chromium-92.0.4515.107-rhel8-force-disable-use_gnome_keyring.patch # And fixes for new compilers Patch400: %{name}-gcc11.patch diff --git a/sources b/sources deleted file mode 100644 index a18d2ac..0000000 --- a/sources +++ /dev/null @@ -1,23 +0,0 @@ -SHA512 (gelasio.zip) = 0a22def3eca8848161ee72453dc5f97cc52ed09ffe21834152f2535d3a71f404cdf1f6e1809564bacb86aae75278cbcb96cae52b537d3ccdc299b60d6d0bc53e -SHA512 (MuktiNarrow-0.94.tar.bz2) = f7abd429e2591eaa047d1ac982d97fa67dc1480c42e55b2a97861abd90918704dce90b6bb27dec7b6d696f188017a74de54a7b7f45281f0515923b90300959d1 -SHA512 (NotoSansCJKjp-hinted.zip) = e7bcbc53a10b8ec3679dcade5a8a94cea7e1f60875ab38f2193b4fa8e33968e1f0abc8184a3df1e5210f6f5c731f96c727c6aa8f519423a29707d2dee5ada193 -SHA512 (lohit-gurmukhi-ttf-2.91.2.tar.gz) = 714ed72d201e7f8956d24e9d9f1526207beb91a604e88c02a8b0d145f19d9bfe1408ca290d1665ebef462ab3854365dcd9850529803277738e2585addf3e280a -SHA512 (Arimo-BoldItalic.ttf) = cb1f411f2630f2754dfb0244b3c56fde43650d603512d47c143bc0f24028da4d7ca2b35a633226ef9c502b97c63cfbd5a6d696934b3e60b2a98ad879b113a4c4 -SHA512 (Arimo-Bold.ttf) = 2853e5f41e6899baf226db2578aba09f2f88085eaea02da024621492d21e1af8bdefdefd354ea23dc4d5de5cb0d554085040a0108820f213e86dd532986fdb41 -SHA512 (Arimo-Italic.ttf) = 56ef918e5811dcd375e6cd8d79dc69f4db75d544639c0f6ac3a0343b3b4ef94b7dee5a6066f1558d8747a32bbee074256be68b943ff31cfbd2f5f32acfa7c1c5 -SHA512 (Arimo-Regular.ttf) = 05e6aa6b785b0038a8e0e0a8a618a1b8e907a700be302148eaebc91cfac3c9e2d9acf90b9d077ff3b9ff54bd5f8a9c522a039cff6103cdeee54be29b6a0b355f -SHA512 (Cousine-BoldItalic.ttf) = 2125aa9f5db4ae4a3725d308b6afbfbce5957f3c96a3c5fcba8ebf5cd167017d9c7023391e947ed68d12fa97e2cba3f156a3acca276d9f5ed50df7d78c07f918 -SHA512 (Cousine-Bold.ttf) = 1759fd23419ae0e1bfc9be92abb9cb0c74084ce85e7f53c055d86ec3d62da83169d0d67ed96fd4e496b28acf382933d63448459108b109d8202db7f18f05caab -SHA512 (Cousine-Italic.ttf) = ec3fc9d940b748dbbc64aa66184413a78ae2b085181eed563449df044b891e951e8feebd865be5be42f0cd001acf5bdce9084a006f9b5be32f096f7df0dc7700 -SHA512 (Cousine-Regular.ttf) = a665a6a4a5583079eb87509e2da7d6bd06965e6a7655217302b088caef942ae9ad63e6cffda18d0001fc9ab2284836766843e46bfdacd188b54f39d7855f36a0 -SHA512 (Tinos-BoldItalic.ttf) = 2574de2add94ef976b731fac688951fab49574c9b0ccd259ba647ea3598ca026bcfb88e2ea3f19effb3af71fdc0eb5fa9973f0b6e996c22185c5f2aab5a23fdd -SHA512 (Tinos-Bold.ttf) = 54aeca804c06a4d5c57ade596e73df91a6a1c4401c4aadba55d987b3fb73045d35f3df02678b59abb77c4914ec741755536c0adf808c931e4b77848c52c229c4 -SHA512 (Tinos-Italic.ttf) = d4f4f096110ef98a781a2a0e0d319317e5f84e650fe6f4d4f6b0e22a16414278217f37497b904a18540273c0e2d79d4f1faabde3b0eb5446283b318c73bafb38 -SHA512 (Tinos-Regular.ttf) = 58085c5dac6d067d60ba2ab3220c4a0cc1efcf279cadfcfb8746a5e5fa1a6f6daa62750dc2051b3b2d8a51b4d2e9bb0f66594caf2253c0870ed9c7286fa45e8f -SHA512 (Ahem.ttf) = aeb64b10ab9c87860714cb60b4900254b13dc52c51319256a1a3722c882026ab7c616bf628fbc2fe14e38a6003f3a481af60b52a7ed62071d28ddaf428e4e3fd -SHA512 (node-v10.15.3-linux-x64.tar.gz) = 5eb544ef706562981340a82acc79e2162c6a3e4049b4a95f69ce353ee5b0f929c60b1fc457e8249b3fb0696f82fc28c5f543f5947db19fae4e9d5c21b906bb20 -SHA512 (xcb-proto-1.14.tar.xz) = de66d568163b6da2be9d6c59984f3afa3acd119a781378638045fd68018665ef5c9af98f024e9962ba3eb7c7a4d85c27ba70ffafceb2324ccc6940f34de16690 -SHA512 (depot_tools.git-master.tar.gz) = dc323888812b66cc92c53a24a8a58ccf9e2961be67aa21852bd091b8b49569071f06ae9104cb58950e6253ac3a29f0db0663e9f35ef2b1ea28696efb38b42708 -SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1dc09f5a0fd7898e9d0a372ee4422b6b1cdab3c86ecc91db437e9ae8a951e64e85edc3ac9e9fca428852dbb2ad -SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a -SHA512 (chromium-92.0.4515.107-clean.tar.xz) = c0da154919e48970f1edde7cabeded907bcd1992c58924fefbfd891ad12aa06e3c643589d89b48d375de507bddf3d01d843a50a0b9376cadbb5a98a651e6d02a From 54692de992b68a5970d5c50a1acc72ce201d0a80 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Mon, 26 Jul 2021 22:41:50 -0400 Subject: [PATCH 015/659] fix sources --- sources | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 sources diff --git a/sources b/sources new file mode 100644 index 0000000..a18d2ac --- /dev/null +++ b/sources @@ -0,0 +1,23 @@ +SHA512 (gelasio.zip) = 0a22def3eca8848161ee72453dc5f97cc52ed09ffe21834152f2535d3a71f404cdf1f6e1809564bacb86aae75278cbcb96cae52b537d3ccdc299b60d6d0bc53e +SHA512 (MuktiNarrow-0.94.tar.bz2) = f7abd429e2591eaa047d1ac982d97fa67dc1480c42e55b2a97861abd90918704dce90b6bb27dec7b6d696f188017a74de54a7b7f45281f0515923b90300959d1 +SHA512 (NotoSansCJKjp-hinted.zip) = e7bcbc53a10b8ec3679dcade5a8a94cea7e1f60875ab38f2193b4fa8e33968e1f0abc8184a3df1e5210f6f5c731f96c727c6aa8f519423a29707d2dee5ada193 +SHA512 (lohit-gurmukhi-ttf-2.91.2.tar.gz) = 714ed72d201e7f8956d24e9d9f1526207beb91a604e88c02a8b0d145f19d9bfe1408ca290d1665ebef462ab3854365dcd9850529803277738e2585addf3e280a +SHA512 (Arimo-BoldItalic.ttf) = cb1f411f2630f2754dfb0244b3c56fde43650d603512d47c143bc0f24028da4d7ca2b35a633226ef9c502b97c63cfbd5a6d696934b3e60b2a98ad879b113a4c4 +SHA512 (Arimo-Bold.ttf) = 2853e5f41e6899baf226db2578aba09f2f88085eaea02da024621492d21e1af8bdefdefd354ea23dc4d5de5cb0d554085040a0108820f213e86dd532986fdb41 +SHA512 (Arimo-Italic.ttf) = 56ef918e5811dcd375e6cd8d79dc69f4db75d544639c0f6ac3a0343b3b4ef94b7dee5a6066f1558d8747a32bbee074256be68b943ff31cfbd2f5f32acfa7c1c5 +SHA512 (Arimo-Regular.ttf) = 05e6aa6b785b0038a8e0e0a8a618a1b8e907a700be302148eaebc91cfac3c9e2d9acf90b9d077ff3b9ff54bd5f8a9c522a039cff6103cdeee54be29b6a0b355f +SHA512 (Cousine-BoldItalic.ttf) = 2125aa9f5db4ae4a3725d308b6afbfbce5957f3c96a3c5fcba8ebf5cd167017d9c7023391e947ed68d12fa97e2cba3f156a3acca276d9f5ed50df7d78c07f918 +SHA512 (Cousine-Bold.ttf) = 1759fd23419ae0e1bfc9be92abb9cb0c74084ce85e7f53c055d86ec3d62da83169d0d67ed96fd4e496b28acf382933d63448459108b109d8202db7f18f05caab +SHA512 (Cousine-Italic.ttf) = ec3fc9d940b748dbbc64aa66184413a78ae2b085181eed563449df044b891e951e8feebd865be5be42f0cd001acf5bdce9084a006f9b5be32f096f7df0dc7700 +SHA512 (Cousine-Regular.ttf) = a665a6a4a5583079eb87509e2da7d6bd06965e6a7655217302b088caef942ae9ad63e6cffda18d0001fc9ab2284836766843e46bfdacd188b54f39d7855f36a0 +SHA512 (Tinos-BoldItalic.ttf) = 2574de2add94ef976b731fac688951fab49574c9b0ccd259ba647ea3598ca026bcfb88e2ea3f19effb3af71fdc0eb5fa9973f0b6e996c22185c5f2aab5a23fdd +SHA512 (Tinos-Bold.ttf) = 54aeca804c06a4d5c57ade596e73df91a6a1c4401c4aadba55d987b3fb73045d35f3df02678b59abb77c4914ec741755536c0adf808c931e4b77848c52c229c4 +SHA512 (Tinos-Italic.ttf) = d4f4f096110ef98a781a2a0e0d319317e5f84e650fe6f4d4f6b0e22a16414278217f37497b904a18540273c0e2d79d4f1faabde3b0eb5446283b318c73bafb38 +SHA512 (Tinos-Regular.ttf) = 58085c5dac6d067d60ba2ab3220c4a0cc1efcf279cadfcfb8746a5e5fa1a6f6daa62750dc2051b3b2d8a51b4d2e9bb0f66594caf2253c0870ed9c7286fa45e8f +SHA512 (Ahem.ttf) = aeb64b10ab9c87860714cb60b4900254b13dc52c51319256a1a3722c882026ab7c616bf628fbc2fe14e38a6003f3a481af60b52a7ed62071d28ddaf428e4e3fd +SHA512 (node-v10.15.3-linux-x64.tar.gz) = 5eb544ef706562981340a82acc79e2162c6a3e4049b4a95f69ce353ee5b0f929c60b1fc457e8249b3fb0696f82fc28c5f543f5947db19fae4e9d5c21b906bb20 +SHA512 (xcb-proto-1.14.tar.xz) = de66d568163b6da2be9d6c59984f3afa3acd119a781378638045fd68018665ef5c9af98f024e9962ba3eb7c7a4d85c27ba70ffafceb2324ccc6940f34de16690 +SHA512 (depot_tools.git-master.tar.gz) = dc323888812b66cc92c53a24a8a58ccf9e2961be67aa21852bd091b8b49569071f06ae9104cb58950e6253ac3a29f0db0663e9f35ef2b1ea28696efb38b42708 +SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1dc09f5a0fd7898e9d0a372ee4422b6b1cdab3c86ecc91db437e9ae8a951e64e85edc3ac9e9fca428852dbb2ad +SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a +SHA512 (chromium-92.0.4515.107-clean.tar.xz) = c0da154919e48970f1edde7cabeded907bcd1992c58924fefbfd891ad12aa06e3c643589d89b48d375de507bddf3d01d843a50a0b9376cadbb5a98a651e6d02a From 925ec8cfeb571a0c13465953548e8e64ba68f896 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Tue, 27 Jul 2021 18:04:45 -0400 Subject: [PATCH 016/659] build fixes and drop python2 --- chromium.spec | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/chromium.spec b/chromium.spec index 067df18..740dcad 100644 --- a/chromium.spec +++ b/chromium.spec @@ -255,7 +255,7 @@ Patch9: chromium-78.0.3904.70-gcc9-drop-rsp-clobber.patch # Try to load widevine from other places Patch10: chromium-92.0.4515.107-widevine-other-locations.patch # Try to fix version.py for Rawhide -Patch11: chromium-92.0.4515.107-py2-bootstrap.patch +Patch11: chromium-92.0.4515.107-py3-bootstrap.patch # Add "Fedora" to the user agent string Patch12: chromium-86.0.4240.75-fedora-user-agent.patch @@ -527,17 +527,17 @@ BuildRequires: pkgconfig(gtk+-3.0) %else BuildRequires: pkgconfig(gtk+-2.0) %endif -BuildRequires: /usr/bin/python2 -BuildRequires: python2-devel +BuildRequires: /usr/bin/python3 +BuildRequires: python3-devel %if 0%{?bundlepylibs} # Using bundled bits, do nothing. %else %if 0%{?fedora} -BuildRequires: python2-beautifulsoup4 -BuildRequires: python2-beautifulsoup -BuildRequires: python2-html5lib -BuildRequires: python2-markupsafe -BuildRequires: python2-ply +BuildRequires: python3-beautifulsoup4 +# BuildRequires: python2-beautifulsoup +BuildRequires: python3-html5lib +BuildRequires: python3-markupsafe +BuildRequires: python3-ply %else BuildRequires: python-beautifulsoup4 BuildRequires: python-BeautifulSoup @@ -545,7 +545,7 @@ BuildRequires: python-html5lib BuildRequires: python-markupsafe BuildRequires: python-ply %endif -BuildRequires: python2-simplejson +BuildRequires: python3-simplejson %endif %if 0%{?bundlere2} # Using bundled bits, do nothing. @@ -857,7 +857,7 @@ Requires(post): systemd Requires(preun): systemd Requires(postun): systemd Requires: xorg-x11-server-Xvfb -Requires: python2-psutil +Requires: python3-psutil %if 0%{?shared} Requires: chromium-libs%{_isa} = %{version}-%{release} %else @@ -981,7 +981,7 @@ udev. # Change shebang in all relevant files in this directory and all subdirectories # See `man find` for how the `-exec command {} +` syntax works -find -type f -exec sed -iE '1s=^#! */usr/bin/\(python\|env python\)[23]\?=#!%{__python2}=' {} + +find -type f -exec sed -iE '1s=^#! */usr/bin/\(python\|env python\)[23]\?=#!%{__python3}=' {} + %if 0%{?asan} export CC="clang" @@ -1159,6 +1159,7 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'base/third_party/valgrind' \ 'base/third_party/xdg_mime' \ 'base/third_party/xdg_user_dirs' \ + 'buildtools/third_party/eu-strip' \ 'buildtools/third_party/libc++' \ 'buildtools/third_party/libc++abi' \ 'chrome/third_party/mozilla_security_manager' \ @@ -1219,6 +1220,7 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/devtools-frontend/src/front_end/third_party/axe-core' \ 'third_party/devtools-frontend/src/front_end/third_party/chromium' \ 'third_party/devtools-frontend/src/front_end/third_party/codemirror' \ + 'third_party/devtools-frontend/src/front_end/third_party/diff' \ 'third_party/devtools-frontend/src/front_end/third_party/i18n' \ 'third_party/devtools-frontend/src/front_end/third_party/intl-messageformat' \ 'third_party/devtools-frontend/src/front_end/third_party/lighthouse' \ @@ -1410,8 +1412,8 @@ build/linux/unbundle/remove_bundled_libraries.py \ %if ! 0%{?bundlepylibs} # Look, I don't know. This package is spit and chewing gum. Sorry. rm -rf third_party/markupsafe -ln -s %{python2_sitearch}/markupsafe third_party/markupsafe -# We should look on removing other python2 packages as well i.e. ply +ln -s %{python3_sitearch}/markupsafe third_party/markupsafe +# We should look on removing other python packages as well i.e. ply %endif # Fix hardcoded path in remoting code @@ -1497,24 +1499,24 @@ sed -i 's|exec "${THIS_DIR}/ninja-linux${LONG_BIT}"|exec "/usr/bin/ninja-build"| %endif # Check that there is no system 'google' module, shadowing bundled ones: -if python2 -c 'import google ; print google.__path__' 2> /dev/null ; then \ - echo "Python 2 'google' module is defined, this will shadow modules of this build"; \ +if python3 -c 'import google ; print google.__path__' 2> /dev/null ; then \ + echo "Python 3 'google' module is defined, this will shadow modules of this build"; \ exit 1 ; \ fi tools/gn/bootstrap/bootstrap.py -v --no-clean --gn-gen-args="$CHROMIUM_CORE_GN_DEFINES $CHROMIUM_BROWSER_GN_DEFINES" -%{builddir}/gn --script-executable=/usr/bin/python2 gen --args="$CHROMIUM_CORE_GN_DEFINES $CHROMIUM_BROWSER_GN_DEFINES" %{builddir} +%{builddir}/gn --script-executable=/usr/bin/python3 gen --args="$CHROMIUM_CORE_GN_DEFINES $CHROMIUM_BROWSER_GN_DEFINES" %{builddir} %if %{freeworld} # do not need to do headless gen %else %if %{build_headless} -%{builddir}/gn --script-executable=/usr/bin/python2 gen --args="$CHROMIUM_CORE_GN_DEFINES $CHROMIUM_HEADLESS_GN_DEFINES" %{headlessbuilddir} +%{builddir}/gn --script-executable=/usr/bin/python3 gen --args="$CHROMIUM_CORE_GN_DEFINES $CHROMIUM_HEADLESS_GN_DEFINES" %{headlessbuilddir} %endif %endif %if %{build_remoting} -%{builddir}/gn --script-executable=/usr/bin/python2 gen --args="$CHROMIUM_CORE_GN_DEFINES $CHROMIUM_BROWSER_GN_DEFINES" %{remotingbuilddir} +%{builddir}/gn --script-executable=/usr/bin/python3 gen --args="$CHROMIUM_CORE_GN_DEFINES $CHROMIUM_BROWSER_GN_DEFINES" %{remotingbuilddir} %endif %if %{bundlelibusbx} @@ -1550,7 +1552,8 @@ tar xf %{SOURCE20} %global optflags %(echo %{optflags} | sed 's/-g /-g1 /') %endif -export PYTHONPATH="../../third_party/pyjson5/src:../../third_party/catapult/third_party/google-endpoints:../../xcb-proto-1.14" +# export PYTHONPATH="../../third_party/pyjson5/src:../../third_party/catapult/third_party/google-endpoints:../../xcb-proto-1.14" +export PYTHONPATH="../../third_party/pyjson5/src:../../xcb-proto-1.14" echo # Now do the full browser @@ -2007,6 +2010,7 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog * Mon Jul 26 2021 Tom Callaway - 92.0.4515.107-1 - update to 92.0.4515.107 +- drop python2 deps (finally) * Wed Jul 21 2021 Fedora Release Engineering - 91.0.4472.164-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild From 42f53340469a9c9b0bc6d3b76b69de0bca49b540 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Tue, 27 Jul 2021 18:06:52 -0400 Subject: [PATCH 017/659] missing patch --- chromium-92.0.4515.107-py3-bootstrap.patch | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 chromium-92.0.4515.107-py3-bootstrap.patch diff --git a/chromium-92.0.4515.107-py3-bootstrap.patch b/chromium-92.0.4515.107-py3-bootstrap.patch new file mode 100644 index 0000000..8455813 --- /dev/null +++ b/chromium-92.0.4515.107-py3-bootstrap.patch @@ -0,0 +1,24 @@ +diff -up chromium-92.0.4515.107/third_party/catapult/common/py_vulcanize/py_vulcanize/generate.py.py2 chromium-92.0.4515.107/third_party/catapult/common/py_vulcanize/py_vulcanize/generate.py +--- chromium-92.0.4515.107/third_party/catapult/common/py_vulcanize/py_vulcanize/generate.py.py2 2021-07-19 14:47:19.000000000 -0400 ++++ chromium-92.0.4515.107/third_party/catapult/common/py_vulcanize/py_vulcanize/generate.py 2021-07-26 17:02:23.160750472 -0400 +@@ -83,7 +83,7 @@ def _MinifyJS(input_js): + + with tempfile.NamedTemporaryFile() as _: + args = [ +- 'python', ++ 'python3', + rjsmin_path + ] + p = subprocess.Popen(args, +diff -up chromium-92.0.4515.107/tools/gn/bootstrap/bootstrap.py.py2 chromium-92.0.4515.107/tools/gn/bootstrap/bootstrap.py +--- chromium-92.0.4515.107/tools/gn/bootstrap/bootstrap.py.py2 2021-07-19 14:45:43.000000000 -0400 ++++ chromium-92.0.4515.107/tools/gn/bootstrap/bootstrap.py 2021-07-26 17:02:23.160750472 -0400 +@@ -130,7 +130,7 @@ def main(argv): + if not options.debug: + gn_gen_args += ' is_debug=false' + subprocess.check_call([ +- gn_path, 'gen', out_dir, ++ gn_path, 'gen', out_dir, ' --script-executable=/usr/bin/python3', + '--args=%s' % gn_gen_args, "--root=" + SRC_ROOT + ]) + From 67cf5d9ba2312e28d15420e917ce44ab250cbb49 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Wed, 28 Jul 2021 12:12:49 -0400 Subject: [PATCH 018/659] add conditionals so we can build with python3 in chromium 93 --- chromium.spec | 66 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 61 insertions(+), 5 deletions(-) diff --git a/chromium.spec b/chromium.spec index 740dcad..882c255 100644 --- a/chromium.spec +++ b/chromium.spec @@ -31,6 +31,15 @@ # This doesn't work and it doesn't even build as of Chromium 83 %global build_remoting 1 +# This will probably be possible with Chromium 93 +%global build_with_python3 0 + +%if 0%{?build_with_python3} +%global chromium_pybin %{__python3} +%else +%global chromium_pybin %{__python2} +%endif + # We'd like to always have this on... # ... but the libva in EL7 (and EL8) is too old. %if 0%{?rhel} == 7 || 0%{?rhel} == 8 @@ -527,8 +536,14 @@ BuildRequires: pkgconfig(gtk+-3.0) %else BuildRequires: pkgconfig(gtk+-2.0) %endif -BuildRequires: /usr/bin/python3 +BuildRequires: %{chromium_pybin} +%if 0%{?build_with_python3} BuildRequires: python3-devel +%else +BuildRequires: python2-devel +%endif + +%if 0%{?build_with_python3} %if 0%{?bundlepylibs} # Using bundled bits, do nothing. %else @@ -547,6 +562,28 @@ BuildRequires: python-ply %endif BuildRequires: python3-simplejson %endif +%else +%if 0%{?bundlepylibs} +# Using bundled bits, do nothing. +%else +%if 0%{?fedora} +BuildRequires: python2-beautifulsoup4 +BuildRequires: python2-beautifulsoup +BuildRequires: python2-html5lib +BuildRequires: python2-markupsafe +BuildRequires: python2-ply +%else +BuildRequires: python-beautifulsoup4 +BuildRequires: python-BeautifulSoup +BuildRequires: python-html5lib +BuildRequires: python-markupsafe +BuildRequires: python-ply +%endif +BuildRequires: python2-simplejson +%endif +%endif + + %if 0%{?bundlere2} # Using bundled bits, do nothing. %else @@ -857,7 +894,11 @@ Requires(post): systemd Requires(preun): systemd Requires(postun): systemd Requires: xorg-x11-server-Xvfb +%if 0%{?build_with_python3} Requires: python3-psutil +%else +Requires: python2-psutil +%endif %if 0%{?shared} Requires: chromium-libs%{_isa} = %{version}-%{release} %else @@ -914,7 +955,9 @@ udev. %patch8 -p1 -b .nofontconfigcache %patch9 -p1 -b .gcc9 %patch10 -p1 -b .widevine-other-locations -%patch11 -p1 -b .py2 +%if 0%{?build_with_python3} +%patch11 -p1 -b .py3 +%endif # Short term fixes (usually gcc and backports) %patch51 -p1 -b .gcc-remoting-constexpr @@ -981,7 +1024,11 @@ udev. # Change shebang in all relevant files in this directory and all subdirectories # See `man find` for how the `-exec command {} +` syntax works +%if 0%{?build_with_python3} find -type f -exec sed -iE '1s=^#! */usr/bin/\(python\|env python\)[23]\?=#!%{__python3}=' {} + +%else +find -type f -exec sed -iE '1s=^#! */usr/bin/\(python\|env python\)[23]\?=#!%{__python2}=' {} + +%endif %if 0%{?asan} export CC="clang" @@ -1412,7 +1459,11 @@ build/linux/unbundle/remove_bundled_libraries.py \ %if ! 0%{?bundlepylibs} # Look, I don't know. This package is spit and chewing gum. Sorry. rm -rf third_party/markupsafe +%if 0%{?build_with_python3} ln -s %{python3_sitearch}/markupsafe third_party/markupsafe +%else +ln -s %{python2_sitearch}/markupsafe third_party/markupsafe +%endif # We should look on removing other python packages as well i.e. ply %endif @@ -1499,24 +1550,29 @@ sed -i 's|exec "${THIS_DIR}/ninja-linux${LONG_BIT}"|exec "/usr/bin/ninja-build"| %endif # Check that there is no system 'google' module, shadowing bundled ones: +%if 0%{?build_with_python3} if python3 -c 'import google ; print google.__path__' 2> /dev/null ; then \ echo "Python 3 'google' module is defined, this will shadow modules of this build"; \ +%else +if python2 -c 'import google ; print google.__path__' 2> /dev/null ; then \ + echo "Python 2 'google' module is defined, this will shadow modules of this build"; \ +%endif exit 1 ; \ fi tools/gn/bootstrap/bootstrap.py -v --no-clean --gn-gen-args="$CHROMIUM_CORE_GN_DEFINES $CHROMIUM_BROWSER_GN_DEFINES" -%{builddir}/gn --script-executable=/usr/bin/python3 gen --args="$CHROMIUM_CORE_GN_DEFINES $CHROMIUM_BROWSER_GN_DEFINES" %{builddir} +%{builddir}/gn --script-executable=%{chromium_pybin} gen --args="$CHROMIUM_CORE_GN_DEFINES $CHROMIUM_BROWSER_GN_DEFINES" %{builddir} %if %{freeworld} # do not need to do headless gen %else %if %{build_headless} -%{builddir}/gn --script-executable=/usr/bin/python3 gen --args="$CHROMIUM_CORE_GN_DEFINES $CHROMIUM_HEADLESS_GN_DEFINES" %{headlessbuilddir} +%{builddir}/gn --script-executable=%{chromium_pybin} gen --args="$CHROMIUM_CORE_GN_DEFINES $CHROMIUM_HEADLESS_GN_DEFINES" %{headlessbuilddir} %endif %endif %if %{build_remoting} -%{builddir}/gn --script-executable=/usr/bin/python3 gen --args="$CHROMIUM_CORE_GN_DEFINES $CHROMIUM_BROWSER_GN_DEFINES" %{remotingbuilddir} +%{builddir}/gn --script-executable=%{chromium_pybin} gen --args="$CHROMIUM_CORE_GN_DEFINES $CHROMIUM_BROWSER_GN_DEFINES" %{remotingbuilddir} %endif %if %{bundlelibusbx} From 239fe17bbef78d6b99afee7cce2340df37f8452f Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Wed, 28 Jul 2021 13:30:43 -0400 Subject: [PATCH 019/659] fun with python --- chromium.spec | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/chromium.spec b/chromium.spec index 882c255..8f9f94d 100644 --- a/chromium.spec +++ b/chromium.spec @@ -34,11 +34,9 @@ # This will probably be possible with Chromium 93 %global build_with_python3 0 -%if 0%{?build_with_python3} +# So, Chromium 92+ needs to run with python3, but has special magic to force python2 where needed. +# Kinda fishy, but it should go away soon and just all be python3. %global chromium_pybin %{__python3} -%else -%global chromium_pybin %{__python2} -%endif # We'd like to always have this on... # ... but the libva in EL7 (and EL8) is too old. @@ -537,9 +535,9 @@ BuildRequires: pkgconfig(gtk+-3.0) BuildRequires: pkgconfig(gtk+-2.0) %endif BuildRequires: %{chromium_pybin} -%if 0%{?build_with_python3} BuildRequires: python3-devel -%else +%if ! %{build_with_python3} +BuildRequires: /usr/bin/python2 BuildRequires: python2-devel %endif From edc94b008fe5da8aeafd93d11b0a3aab90a2ebc4 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Wed, 28 Jul 2021 15:57:57 -0400 Subject: [PATCH 020/659] minor py3 fixes --- chromium-92.0.4515.107-py3-fixes.patch | 17 +++++++++++++++++ chromium.spec | 3 +++ 2 files changed, 20 insertions(+) create mode 100644 chromium-92.0.4515.107-py3-fixes.patch diff --git a/chromium-92.0.4515.107-py3-fixes.patch b/chromium-92.0.4515.107-py3-fixes.patch new file mode 100644 index 0000000..81ae7f6 --- /dev/null +++ b/chromium-92.0.4515.107-py3-fixes.patch @@ -0,0 +1,17 @@ +diff -up chromium-92.0.4515.107/third_party/jinja2/tests.py.py3 chromium-92.0.4515.107/third_party/jinja2/tests.py +--- chromium-92.0.4515.107/third_party/jinja2/tests.py.py3 2021-07-28 15:53:45.670961029 -0400 ++++ chromium-92.0.4515.107/third_party/jinja2/tests.py 2021-07-28 15:55:56.637013096 -0400 +@@ -10,7 +10,12 @@ + """ + import operator + import re +-from collections import Mapping ++import sys ++if sys.version_info[:2] >= (3, 8): # pragma: no cover ++ from collections.abc import Mapping ++else: # pragma: no cover ++ from collections import Mapping ++ + from jinja2.runtime import Undefined + from jinja2._compat import text_type, string_types, integer_types + import decimal diff --git a/chromium.spec b/chromium.spec index 8f9f94d..5a8a8d8 100644 --- a/chromium.spec +++ b/chromium.spec @@ -316,6 +316,8 @@ Patch79: chromium-90.0.4430.72-widevine-no-download.patch Patch80: chromium-92.0.4515.107-EnumTable-crash.patch # https://github.com/stha09/chromium-patches/blob/master/chromium-92-v8-constexpr.patch Patch82: chromium-92-v8-constexpr.patch +# Fixes for python3 +Patch83: chromium-92.0.4515.107-py3-fixes.patch # Use lstdc++ on EPEL7 only @@ -984,6 +986,7 @@ udev. %patch79 -p1 -b .widevine-no-download %patch80 -p1 -b .EnumTable-crash %patch82 -p1 -b .v8-constexpr +%patch83 -p1 -b .py3fixes # Fedora branded user agent %if 0%{?fedora} From 82490cb173dfafa8c44a4efe7d99c3e53909b70d Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Mon, 2 Aug 2021 11:08:06 -0400 Subject: [PATCH 021/659] more python hackery --- chromium.spec | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/chromium.spec b/chromium.spec index 5a8a8d8..7864b77 100644 --- a/chromium.spec +++ b/chromium.spec @@ -31,12 +31,15 @@ # This doesn't work and it doesn't even build as of Chromium 83 %global build_remoting 1 -# This will probably be possible with Chromium 93 -%global build_with_python3 0 +# This will probably be truely possible with Chromium 93 +# Right now, we fake it a bit and pull in both python2 and python3 stacks. sorry. +%global build_with_python3 1 -# So, Chromium 92+ needs to run with python3, but has special magic to force python2 where needed. -# Kinda fishy, but it should go away soon and just all be python3. +%if 0%{?build_with_python3} %global chromium_pybin %{__python3} +%else +%global chromium_pybin %{__python2} +%endif # We'd like to always have this on... # ... but the libva in EL7 (and EL8) is too old. @@ -262,7 +265,11 @@ Patch9: chromium-78.0.3904.70-gcc9-drop-rsp-clobber.patch # Try to load widevine from other places Patch10: chromium-92.0.4515.107-widevine-other-locations.patch # Try to fix version.py for Rawhide -Patch11: chromium-92.0.4515.107-py3-bootstrap.patch +%if 0%{?build_with_python3} +Patch11: chromium-92.0.4515.107-py3-bootstrap.patch +%else +Patch11: chromium-92.0.4515.107-py2-bootstrap.patch +%endif # Add "Fedora" to the user agent string Patch12: chromium-86.0.4240.75-fedora-user-agent.patch @@ -537,13 +544,13 @@ BuildRequires: pkgconfig(gtk+-3.0) BuildRequires: pkgconfig(gtk+-2.0) %endif BuildRequires: %{chromium_pybin} -BuildRequires: python3-devel -%if ! %{build_with_python3} -BuildRequires: /usr/bin/python2 +# %%if ! %%{build_with_python3} BuildRequires: python2-devel -%endif +# %%else +BuildRequires: python3-devel +# %%endif -%if 0%{?build_with_python3} +# %%if 0%{?build_with_python3} %if 0%{?bundlepylibs} # Using bundled bits, do nothing. %else @@ -562,7 +569,7 @@ BuildRequires: python-ply %endif BuildRequires: python3-simplejson %endif -%else +#%%else %if 0%{?bundlepylibs} # Using bundled bits, do nothing. %else @@ -581,7 +588,7 @@ BuildRequires: python-ply %endif BuildRequires: python2-simplejson %endif -%endif +# %%endif %if 0%{?bundlere2} From bb2c9f3934e9423689f40d411c1d2dae1b967c4d Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Mon, 2 Aug 2021 13:17:48 -0400 Subject: [PATCH 022/659] fix build with freetype 2.11 --- chromium-freetype-2.11.patch | 50 ++++++++++++++++++++++++++++++++++++ chromium.spec | 4 ++- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 chromium-freetype-2.11.patch diff --git a/chromium-freetype-2.11.patch b/chromium-freetype-2.11.patch new file mode 100644 index 0000000..aee6dc8 --- /dev/null +++ b/chromium-freetype-2.11.patch @@ -0,0 +1,50 @@ +--- a/third_party/skia/src/ports/SkFontHost_FreeType_common.cpp ++++ b/third_party/skia/src/ports/SkFontHost_FreeType_common.cpp +@@ -712,7 +712,11 @@ void colrv1_draw_paint(SkCanvas* canvas, + canvas->drawPaint(colrPaint); + break; + } ++#if FREETYPE_MAJOR == 2 && FREETYPE_MINOR >= 11 ++ case FT_COLR_PAINTFORMAT_TRANSFORM: ++#else + case FT_COLR_PAINTFORMAT_TRANSFORMED: ++#endif + case FT_COLR_PAINTFORMAT_TRANSLATE: + case FT_COLR_PAINTFORMAT_ROTATE: + case FT_COLR_PAINTFORMAT_SKEW: +@@ -759,10 +763,17 @@ void colrv1_transform(SkCanvas* canvas, FT_Face face, FT_COLR_Paint colrv1_paint + SkMatrix transform; + + switch (colrv1_paint.format) { ++#if FREETYPE_MAJOR == 2 && FREETYPE_MINOR >= 11 ++ case FT_COLR_PAINTFORMAT_TRANSFORM: { ++ transform = ToSkMatrix(colrv1_paint.u.transform.affine); ++ break; ++ } ++#else + case FT_COLR_PAINTFORMAT_TRANSFORMED: { + transform = ToSkMatrix(colrv1_paint.u.transformed.affine); + break; + } ++#endif + case FT_COLR_PAINTFORMAT_TRANSLATE: { + transform = SkMatrix::Translate( + SkFixedToScalar(colrv1_paint.u.translate.dx), +@@ -880,10 +891,17 @@ bool colrv1_traverse_paint(SkCanvas* canvas, + traverse_result = colrv1_start_glyph(canvas, palette, face, paint.u.colr_glyph.glyphID, + FT_COLOR_NO_ROOT_TRANSFORM); + break; ++#if FREETYPE_MAJOR == 2 && FREETYPE_MINOR >= 11 ++ case FT_COLR_PAINTFORMAT_TRANSFORM: ++ colrv1_transform(canvas, face, paint); ++ traverse_result = colrv1_traverse_paint(canvas, palette, face, ++ paint.u.transform.paint, visited_set); ++#else + case FT_COLR_PAINTFORMAT_TRANSFORMED: + colrv1_transform(canvas, face, paint); + traverse_result = colrv1_traverse_paint(canvas, palette, face, + paint.u.transformed.paint, visited_set); ++#endif + break; + case FT_COLR_PAINTFORMAT_TRANSLATE: + colrv1_transform(canvas, face, paint); diff --git a/chromium.spec b/chromium.spec index 7864b77..c9ec20f 100644 --- a/chromium.spec +++ b/chromium.spec @@ -325,7 +325,8 @@ Patch80: chromium-92.0.4515.107-EnumTable-crash.patch Patch82: chromium-92-v8-constexpr.patch # Fixes for python3 Patch83: chromium-92.0.4515.107-py3-fixes.patch - +# Fix build with Freetype 2.11 +Patch84: https://gitweb.gentoo.org/repo/gentoo.git/plain/www-client/chromium/files/chromium-freetype-2.11.patch # Use lstdc++ on EPEL7 only Patch101: chromium-75.0.3770.100-epel7-stdc++.patch @@ -994,6 +995,7 @@ udev. %patch80 -p1 -b .EnumTable-crash %patch82 -p1 -b .v8-constexpr %patch83 -p1 -b .py3fixes +%patch84 -p1 -b .freetype-2.11 # Fedora branded user agent %if 0%{?fedora} From 34b9d4c78d1980d2fa9386643993462310544c68 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Wed, 25 Aug 2021 09:57:56 -0400 Subject: [PATCH 023/659] 92.0.4515.159, clone3 fix, python3 everywhere we can --- chromium-92-clang-format.patch | 25 +++++++++++++++++++++ chromium-92.0.4515.107-sandbox-clone3.patch | 16 +++++++++++++ chromium.spec | 19 ++++++++++++++-- sources | 2 +- 4 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 chromium-92-clang-format.patch create mode 100644 chromium-92.0.4515.107-sandbox-clone3.patch diff --git a/chromium-92-clang-format.patch b/chromium-92-clang-format.patch new file mode 100644 index 0000000..0ba7ee2 --- /dev/null +++ b/chromium-92-clang-format.patch @@ -0,0 +1,25 @@ +--- a/buildtools/linux64/clang-format.orig 2021-08-23 09:18:56.269570955 +0200 ++++ b/buildtools/linux64/clang-format 2021-08-23 09:17:55.531190516 +0200 +@@ -10,9 +10,9 @@ + args = sys.argv[1:] + inputfiles = [a for a in args if not a.startswith('-')] + +-contents = '' ++contents = b'' + if '-' in args or not inputfiles: +- contents = sys.stdin.read() ++ contents = sys.stdin.buffer.read() + + # Tarball builds may or may not have depot_tools in $PATH. In the former case, + # running 'clang-format' will call back into this script infinitely. Strip off +@@ -34,8 +34,8 @@ + stdout, stderr = proc.communicate(input=contents) + # Ignore if clang-format fails. Eg: it may be too old to support C++14. + if proc.returncode == 0: +- sys.stdout.write(stdout) +- sys.stderr.write(stderr) ++ sys.stdout.buffer.write(stdout) ++ sys.stderr.buffer.write(stderr) + sys.exit(0) + except OSError: + # Ignore if clang-format is not installed. diff --git a/chromium-92.0.4515.107-sandbox-clone3.patch b/chromium-92.0.4515.107-sandbox-clone3.patch new file mode 100644 index 0000000..a439935 --- /dev/null +++ b/chromium-92.0.4515.107-sandbox-clone3.patch @@ -0,0 +1,16 @@ +diff -up chromium-92.0.4515.107/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc.clone3 chromium-92.0.4515.107/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc +--- chromium-92.0.4515.107/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc.clone3 2021-08-16 09:05:35.836277326 -0400 ++++ chromium-92.0.4515.107/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc 2021-08-16 09:06:17.420502628 -0400 +@@ -178,6 +178,12 @@ ResultExpr EvaluateSyscallImpl(int fs_de + return RestrictCloneToThreadsAndEPERMFork(); + } + ++ // clone3 takes a pointer argument which we cannot examine, so return ENOSYS ++ // to force the libc to use clone. See https://crbug.com/1213452. ++ if (sysno == __NR_clone3) { ++ return Error(ENOSYS); ++ } ++ + if (sysno == __NR_fcntl) + return RestrictFcntlCommands(); + diff --git a/chromium.spec b/chromium.spec index c9ec20f..e186fa6 100644 --- a/chromium.spec +++ b/chromium.spec @@ -225,7 +225,7 @@ Name: chromium%{chromium_channel}%{nsuffix} %else Name: chromium%{chromium_channel} %endif -Version: %{majorversion}.0.4515.107 +Version: %{majorversion}.0.4515.159 Release: 1%{?dist} %if %{?freeworld} %if %{?shared} @@ -327,6 +327,13 @@ Patch82: chromium-92-v8-constexpr.patch Patch83: chromium-92.0.4515.107-py3-fixes.patch # Fix build with Freetype 2.11 Patch84: https://gitweb.gentoo.org/repo/gentoo.git/plain/www-client/chromium/files/chromium-freetype-2.11.patch +# https://bugs.chromium.org/p/chromium/issues/detail?id=1213452 +# https://chromium.googlesource.com/chromium/src/sandbox/+/482404adee4fc0487452c7ae5ac9c192b0f4fd30%5E%21/#F0 +# Needed for F35+, but safe everywhere +Patch85: chromium-92.0.4515.107-sandbox-clone3.patch +# Clean up clang-format for python3 +# thanks to Jon Nettleton +Patch86: chromium-92-clang-format.patch # Use lstdc++ on EPEL7 only Patch101: chromium-75.0.3770.100-epel7-stdc++.patch @@ -354,7 +361,6 @@ Patch109: chromium-90.0.4430.93-epel7-erase-fix.patch # AARCH64 neon symbols need to be prefixed too to prevent multiple definition issue at linktime Patch110: chromium-90.0.4430.93-epel8-aarch64-libpng16-symbol-prefixes.patch - # VAAPI # Upstream turned VAAPI on in Linux in 86 Patch202: chromium-89.0.4389.72-enable-hardware-accelerated-mjpeg.patch @@ -996,6 +1002,8 @@ udev. %patch82 -p1 -b .v8-constexpr %patch83 -p1 -b .py3fixes %patch84 -p1 -b .freetype-2.11 +%patch85 -p1 -b .clone3 +%patch86 -p1 -b .clang-format-py3 # Fedora branded user agent %if 0%{?fedora} @@ -2074,6 +2082,13 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Tue Aug 17 2021 Tom Callaway - 92.0.4515.159-1 +- update to 92.0.4515.159 + +* Mon Aug 16 2021 Tom Callaway - 92.0.4515.131-1 +- update to 92.0.4515.131 +- apply upstream fix for clone3 crash + * Mon Jul 26 2021 Tom Callaway - 92.0.4515.107-1 - update to 92.0.4515.107 - drop python2 deps (finally) diff --git a/sources b/sources index a18d2ac..aef7285 100644 --- a/sources +++ b/sources @@ -20,4 +20,4 @@ SHA512 (xcb-proto-1.14.tar.xz) = de66d568163b6da2be9d6c59984f3afa3acd119a7813786 SHA512 (depot_tools.git-master.tar.gz) = dc323888812b66cc92c53a24a8a58ccf9e2961be67aa21852bd091b8b49569071f06ae9104cb58950e6253ac3a29f0db0663e9f35ef2b1ea28696efb38b42708 SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1dc09f5a0fd7898e9d0a372ee4422b6b1cdab3c86ecc91db437e9ae8a951e64e85edc3ac9e9fca428852dbb2ad SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a -SHA512 (chromium-92.0.4515.107-clean.tar.xz) = c0da154919e48970f1edde7cabeded907bcd1992c58924fefbfd891ad12aa06e3c643589d89b48d375de507bddf3d01d843a50a0b9376cadbb5a98a651e6d02a +SHA512 (chromium-92.0.4515.159-clean.tar.xz) = e5062c35c55232f672008d7c4a06daa69a92e0ed4104ea78e60280e2d7d20bcbf1b52c33229fd3b81983b02cbc949d188e5385b6250662248e11660d1fced31d From 712b66b282b13172b706ee52bb0cb2fc1f89e41b Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Wed, 25 Aug 2021 10:30:36 -0400 Subject: [PATCH 024/659] back out clang-format patch --- chromium.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chromium.spec b/chromium.spec index e186fa6..c0c93ec 100644 --- a/chromium.spec +++ b/chromium.spec @@ -1003,7 +1003,8 @@ udev. %patch83 -p1 -b .py3fixes %patch84 -p1 -b .freetype-2.11 %patch85 -p1 -b .clone3 -%patch86 -p1 -b .clang-format-py3 +# Still using python2 in 92. +# %%patch86 -p1 -b .clang-format-py3 # Fedora branded user agent %if 0%{?fedora} From 302a80b51497b38afd4e1bbb8bc07b3dc617abb1 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Thu, 26 Aug 2021 08:23:52 -0400 Subject: [PATCH 025/659] work around stupid binary bundling of eu-strip --- chromium.spec | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/chromium.spec b/chromium.spec index c0c93ec..4f13b61 100644 --- a/chromium.spec +++ b/chromium.spec @@ -484,6 +484,8 @@ BuildRequires: libstdc++-devel, openssl-devel # Fedora tries to use system libs whenever it can. BuildRequires: bzip2-devel BuildRequires: dbus-glib-devel +# For eu-strip +BuildRequires: elfutils BuildRequires: elfutils-libelf-devel BuildRequires: flac-devel %if 0%{?bundlefreetype} @@ -1560,6 +1562,11 @@ sed -i '/aarch64)/ a \ exec "/usr/bin/ninja-build" "$@";;\' ../depot_tool %endif sed -i 's|exec "${THIS_DIR}/ninja-linux${LONG_BIT}"|exec "/usr/bin/ninja-build"|g' ../depot_tools/ninja +# Get rid of the pre-built eu-strip binary, it is x86_64 and of mysterious origin +rm -rf buildtools/third_party/eu-strip/bin/eu-strip +# Replace it with a symlink to the Fedora copy +ln -s %{_bindir}/eu-strip buildtools/third_party/eu-strip/bin/eu-strip + %if 0%{?rhel} == 7 . /opt/rh/devtoolset-%{dts_version}/enable %endif From 0c90ee963f42ff36639aa80c3b0e01044de446b9 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Mon, 30 Aug 2021 09:34:16 -0400 Subject: [PATCH 026/659] disable userfaultd code in epel8, include crashpad_handler it works a lot better when it doesnt immediately crash because of this missing file --- chromium-92.0.4515.159-epel8-uffd-off.patch | 12 ++++++++++++ chromium.spec | 11 ++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 chromium-92.0.4515.159-epel8-uffd-off.patch diff --git a/chromium-92.0.4515.159-epel8-uffd-off.patch b/chromium-92.0.4515.159-epel8-uffd-off.patch new file mode 100644 index 0000000..dc6938e --- /dev/null +++ b/chromium-92.0.4515.159-epel8-uffd-off.patch @@ -0,0 +1,12 @@ +diff -up chromium-92.0.4515.159/base/allocator/partition_allocator/partition_alloc_config.h.epel8-uffd-off chromium-92.0.4515.159/base/allocator/partition_allocator/partition_alloc_config.h +--- chromium-92.0.4515.159/base/allocator/partition_allocator/partition_alloc_config.h.epel8-uffd-off 2021-08-30 09:25:56.878243728 -0400 ++++ chromium-92.0.4515.159/base/allocator/partition_allocator/partition_alloc_config.h 2021-08-30 09:26:12.489322762 -0400 +@@ -37,7 +37,7 @@ static_assert(sizeof(void*) != 8, ""); + #if defined(PA_HAS_64_BITS_POINTERS) && \ + (defined(OS_LINUX) || defined(OS_ANDROID)) + // TODO(bikineev): Enable for ChromeOS. +-#define PA_STARSCAN_UFFD_WRITE_PROTECTOR_SUPPORTED ++#define PA_STARSCAN_UFFD_WRITE_PROTECTOR_SUPPORTED 0 + #endif + + // POSIX is not only UNIX, e.g. macOS and other OSes. We do use Linux-specific diff --git a/chromium.spec b/chromium.spec index 4f13b61..ea42072 100644 --- a/chromium.spec +++ b/chromium.spec @@ -226,7 +226,7 @@ Name: chromium%{chromium_channel}%{nsuffix} Name: chromium%{chromium_channel} %endif Version: %{majorversion}.0.4515.159 -Release: 1%{?dist} +Release: 2%{?dist} %if %{?freeworld} %if %{?shared} # chromium-libs-media-freeworld @@ -360,6 +360,9 @@ Patch109: chromium-90.0.4430.93-epel7-erase-fix.patch # Again, not sure how epel8 is the only one to hit this... # AARCH64 neon symbols need to be prefixed too to prevent multiple definition issue at linktime Patch110: chromium-90.0.4430.93-epel8-aarch64-libpng16-symbol-prefixes.patch +# The implementation of linux/userfaultfd.h in EL-8 is too old to support what Chromium wants to do. Turn off the relevant chromium code. +Patch111: chromium-92.0.4515.159-epel8-uffd-off.patch + # VAAPI # Upstream turned VAAPI on in Linux in 86 @@ -1026,6 +1029,7 @@ udev. %if 0%{?rhel} == 8 # %%patch107 -p1 -b .el8-arm-incompatible-ints %patch110 -p1 -b .el8-aarch64-libpng16-symbol-prefixes +%patch111 -p1 -b .el8-uffd-off %endif # Feature specific patches @@ -1704,6 +1708,7 @@ rm -rf %{buildroot} %endif cp -a chrome %{buildroot}%{chromium_path}/%{chromium_browser_channel} cp -a chrome_sandbox %{buildroot}%{chromium_path}/chrome-sandbox + cp -a crashpad_handler %{buildroot}%{chromium_path}/crashpad_handler cp -a ../../chrome/app/resources/manpage.1.in %{buildroot}%{_mandir}/man1/%{chromium_browser_channel}.1 sed -i "s|@@PACKAGE@@|%{chromium_browser_channel}|g" %{buildroot}%{_mandir}/man1/%{chromium_browser_channel}.1 sed -i "s|@@MENUNAME@@|%{chromium_menu_name}|g" %{buildroot}%{_mandir}/man1/%{chromium_browser_channel}.1 @@ -2090,6 +2095,10 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Mon Aug 30 2021 Tom Callaway - 92.0.4515.159-2 +- disable userfaultd code in epel8 +- include crashpad_handler (it works a lot better when it doesn't immediately crash because of this missing file) + * Tue Aug 17 2021 Tom Callaway - 92.0.4515.159-1 - update to 92.0.4515.159 From da935cef06851c414b666a7098cf2f0601126c57 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Mon, 30 Aug 2021 14:19:15 -0400 Subject: [PATCH 027/659] looks like it needs to be undefined, not just set to 0 --- chromium-92.0.4515.159-epel8-uffd-off.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chromium-92.0.4515.159-epel8-uffd-off.patch b/chromium-92.0.4515.159-epel8-uffd-off.patch index dc6938e..553b9b0 100644 --- a/chromium-92.0.4515.159-epel8-uffd-off.patch +++ b/chromium-92.0.4515.159-epel8-uffd-off.patch @@ -6,7 +6,7 @@ diff -up chromium-92.0.4515.159/base/allocator/partition_allocator/partition_all (defined(OS_LINUX) || defined(OS_ANDROID)) // TODO(bikineev): Enable for ChromeOS. -#define PA_STARSCAN_UFFD_WRITE_PROTECTOR_SUPPORTED -+#define PA_STARSCAN_UFFD_WRITE_PROTECTOR_SUPPORTED 0 ++// #define PA_STARSCAN_UFFD_WRITE_PROTECTOR_SUPPORTED #endif // POSIX is not only UNIX, e.g. macOS and other OSes. We do use Linux-specific From a36ca5230ab2b5f785eab9e31317818bcab9e75d Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Mon, 30 Aug 2021 18:36:00 -0400 Subject: [PATCH 028/659] disable clone3 fix for epel8 --- chromium.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chromium.spec b/chromium.spec index ea42072..571cadb 100644 --- a/chromium.spec +++ b/chromium.spec @@ -329,7 +329,7 @@ Patch83: chromium-92.0.4515.107-py3-fixes.patch Patch84: https://gitweb.gentoo.org/repo/gentoo.git/plain/www-client/chromium/files/chromium-freetype-2.11.patch # https://bugs.chromium.org/p/chromium/issues/detail?id=1213452 # https://chromium.googlesource.com/chromium/src/sandbox/+/482404adee4fc0487452c7ae5ac9c192b0f4fd30%5E%21/#F0 -# Needed for F35+, but safe everywhere +# Needed for F35+, but safe everywhere (except epel8 which is too old to know about __NR_clone3) Patch85: chromium-92.0.4515.107-sandbox-clone3.patch # Clean up clang-format for python3 # thanks to Jon Nettleton @@ -1007,7 +1007,9 @@ udev. %patch82 -p1 -b .v8-constexpr %patch83 -p1 -b .py3fixes %patch84 -p1 -b .freetype-2.11 +%if 0%{?fedora} %patch85 -p1 -b .clone3 +%endif # Still using python2 in 92. # %%patch86 -p1 -b .clang-format-py3 From 8af1ce5b1dfc48d2cc58463d72b773cf94e07c27 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Tue, 31 Aug 2021 06:38:30 -0400 Subject: [PATCH 029/659] add crashpad_handler to %files --- chromium.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/chromium.spec b/chromium.spec index 571cadb..f7981ef 100644 --- a/chromium.spec +++ b/chromium.spec @@ -1942,6 +1942,7 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %dir %{chromium_path} %{chromium_path}/*.bin %{chromium_path}/chrome_*.pak +%{chromium_path}/crashpad_handler %{chromium_path}/resources.pak %{chromium_path}/icudtl.dat %{chromium_path}/%{chromium_browser_channel} From ff282d654ac935512bfb7cc2db8337ad81e72e13 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Fri, 3 Sep 2021 17:34:13 -0400 Subject: [PATCH 030/659] 93 --- ...cc-fix-swiftshader-libEGL-visibility.patch | 26 ---- ...BluetoothLowEnergyScanFilter-include.patch | 30 +++++ chromium-93-ClassProperty-include.patch | 30 +++++ chromium-93-ContextSet-permissive.patch | 47 +++++++ ...olsEmbedderMessageDispatcher-include.patch | 24 ++++ chromium-93-FormForest-constexpr.patch | 49 ++++++++ chromium-93-HashPasswordManager-include.patch | 30 +++++ ...-ScopedTestDialogAutoConfirm-include.patch | 24 ++++ chromium-93-pdfium-include.patch | 117 ++++++++++++++++++ chromium-93.0.4577.63-clang-format.patch | 34 +++++ chromium-93.0.4577.63-freetype-2.11.patch | 52 ++++++++ chromium-93.0.4577.63-missing-cstring.patch | 45 +++++++ chromium-93.0.4577.63-mojo-header-fix.patch | 12 ++ chromium-93.0.4577.63-norar.patch | 90 ++++++++++++++ chromium-93.0.4577.63-py3-bootstrap.patch | 12 ++ ....0.4577.63-remoting-nodestructor-fix.patch | 21 ++++ chromium-93.0.4577.63-vector-fix.patch | 11 ++ ...um-93.0.4577.63-widevine-no-download.patch | 14 +++ chromium.spec | 117 ++++++++++-------- clean_ffmpeg.sh | 4 +- sources | 1 + 21 files changed, 711 insertions(+), 79 deletions(-) delete mode 100644 chromium-88.0.4324.182-gcc-fix-swiftshader-libEGL-visibility.patch create mode 100644 chromium-93-BluetoothLowEnergyScanFilter-include.patch create mode 100644 chromium-93-ClassProperty-include.patch create mode 100644 chromium-93-ContextSet-permissive.patch create mode 100644 chromium-93-DevToolsEmbedderMessageDispatcher-include.patch create mode 100644 chromium-93-FormForest-constexpr.patch create mode 100644 chromium-93-HashPasswordManager-include.patch create mode 100644 chromium-93-ScopedTestDialogAutoConfirm-include.patch create mode 100644 chromium-93-pdfium-include.patch create mode 100644 chromium-93.0.4577.63-clang-format.patch create mode 100644 chromium-93.0.4577.63-freetype-2.11.patch create mode 100644 chromium-93.0.4577.63-missing-cstring.patch create mode 100644 chromium-93.0.4577.63-mojo-header-fix.patch create mode 100644 chromium-93.0.4577.63-norar.patch create mode 100644 chromium-93.0.4577.63-py3-bootstrap.patch create mode 100644 chromium-93.0.4577.63-remoting-nodestructor-fix.patch create mode 100644 chromium-93.0.4577.63-vector-fix.patch create mode 100644 chromium-93.0.4577.63-widevine-no-download.patch diff --git a/chromium-88.0.4324.182-gcc-fix-swiftshader-libEGL-visibility.patch b/chromium-88.0.4324.182-gcc-fix-swiftshader-libEGL-visibility.patch deleted file mode 100644 index d1bbe88..0000000 --- a/chromium-88.0.4324.182-gcc-fix-swiftshader-libEGL-visibility.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -up chromium-88.0.4324.182/third_party/swiftshader/src/OpenGL/libEGL/BUILD.gn.gcc-swiftshader-visibility chromium-88.0.4324.182/third_party/swiftshader/src/OpenGL/libEGL/BUILD.gn ---- chromium-88.0.4324.182/third_party/swiftshader/src/OpenGL/libEGL/BUILD.gn.gcc-swiftshader-visibility 2021-02-25 16:31:51.929335783 +0000 -+++ chromium-88.0.4324.182/third_party/swiftshader/src/OpenGL/libEGL/BUILD.gn 2021-02-25 16:31:51.929335783 +0000 -@@ -42,7 +42,8 @@ config("swiftshader_libEGL_private_confi - } else if (is_clang) { - defines += [ "EGLAPI=__attribute__((visibility(\"protected\"))) __attribute__((no_sanitize(\"function\")))" ] - } else { -- defines += [ "EGLAPI= " ] -+ cflags += [ "-fvisibility=protected" ] -+ defines += [ "EGLAPI=__attribute__((visibility(\"protected\")))" ] - } - } - } -diff -up chromium-88.0.4324.182/third_party/swiftshader/src/OpenGL/libGLESv2/BUILD.gn.gcc-swiftshader-visibility chromium-88.0.4324.182/third_party/swiftshader/src/OpenGL/libGLESv2/BUILD.gn ---- chromium-88.0.4324.182/third_party/swiftshader/src/OpenGL/libGLESv2/BUILD.gn.gcc-swiftshader-visibility 2021-02-25 18:16:28.576901417 +0000 -+++ chromium-88.0.4324.182/third_party/swiftshader/src/OpenGL/libGLESv2/BUILD.gn 2021-02-25 18:17:50.356567690 +0000 -@@ -57,7 +57,8 @@ config("swiftshader_libGLESv2_private_co - } else if (is_clang) { - defines += [ "GL_APICALL=__attribute__((visibility(\"protected\"))) __attribute__((no_sanitize(\"function\")))" ] - } else { -- defines += [ "GL_APICALL= " ] -+ cflags += [ "-fvisibility=protected" ] -+ defines += [ "GL_APICALL=__attribute__((visibility(\"protected\")))" ] - } - } - } diff --git a/chromium-93-BluetoothLowEnergyScanFilter-include.patch b/chromium-93-BluetoothLowEnergyScanFilter-include.patch new file mode 100644 index 0000000..aa1c033 --- /dev/null +++ b/chromium-93-BluetoothLowEnergyScanFilter-include.patch @@ -0,0 +1,30 @@ +From 2f5514051210388bfcff605570d33f08cfa7bcaa Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz +Date: Wed, 21 Jul 2021 08:34:58 +0000 +Subject: [PATCH] IWYU: usage of unique_ptr requires including in bluetooth low energy scan filter. + +Fix build because of missing include: +../../device/bluetooth/bluetooth_low_energy_scan_filter.h:57:15: error: ‘unique_ptr’ in namespace ‘std’ does not name a template type + 57 | static std::unique_ptr Create( + | ^~~~~~~~~~ + +Bug: 819294 +Change-Id: I347953a083f1bcdf744fd86e1a73954c6f86b32e +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3041155 +Reviewed-by: Reilly Grant +Commit-Queue: José Dapena Paz +Cr-Commit-Position: refs/heads/master@{#903819} +--- + +diff --git a/device/bluetooth/bluetooth_low_energy_scan_filter.h b/device/bluetooth/bluetooth_low_energy_scan_filter.h +index a0436c1..7ae606c 100644 +--- a/device/bluetooth/bluetooth_low_energy_scan_filter.h ++++ b/device/bluetooth/bluetooth_low_energy_scan_filter.h +@@ -7,6 +7,7 @@ + + #include + #include ++#include + #include + + #include "base/time/time.h" diff --git a/chromium-93-ClassProperty-include.patch b/chromium-93-ClassProperty-include.patch new file mode 100644 index 0000000..b5f81b4 --- /dev/null +++ b/chromium-93-ClassProperty-include.patch @@ -0,0 +1,30 @@ +From 8ae99ee447cf5f0160ea4ae978cdf37f5dcecd1e Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz +Date: Wed, 21 Jul 2021 08:36:20 +0000 +Subject: [PATCH] IWYU: missing memory include for unique_ptr usage in class_property.h + +Fix GCC build breakage because of missing inclide: +./../ui/base/class_property.h:120:58: error: ‘std::unique_ptr’ has not been declared + 120 | T* SetProperty(const ClassProperty* property, std::unique_ptr value); + | ^~~~~~~~~~ + +Bug: 819294 +Change-Id: I46b921876702b8d44674689bbb5acdc107db21e5 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3041030 +Reviewed-by: Peter Boström +Commit-Queue: José Dapena Paz +Cr-Commit-Position: refs/heads/master@{#903820} +--- + +diff --git a/ui/base/class_property.h b/ui/base/class_property.h +index f7b2f55..88b4938 100644 +--- a/ui/base/class_property.h ++++ b/ui/base/class_property.h +@@ -8,6 +8,7 @@ + #include + + #include ++#include + #include + #include + diff --git a/chromium-93-ContextSet-permissive.patch b/chromium-93-ContextSet-permissive.patch new file mode 100644 index 0000000..4606504 --- /dev/null +++ b/chromium-93-ContextSet-permissive.patch @@ -0,0 +1,47 @@ +From 7108f83c8ad1bad4072e4f32da3db6d59cf51400 Mon Sep 17 00:00:00 2001 +From: Ivan Murashov +Date: Tue, 20 Jul 2021 13:16:44 +0300 +Subject: [PATCH] GCC: Remove double declaration of ContextSet + +After the CL +https://chromium-review.googlesource.com/c/angle/angle/+/2965780 +the build with GCC failed with error: +/third_party/angle/src/libANGLE/Display.h:325:37: error: declaration of +'typedef class std::__1::set egl::Display::ContextSet' +changes meaning of 'ContextSet' [-fpermissive] +/third_party/angle/src/libANGLE/Display.h:75:7: note: 'ContextSet' +declared here as 'using ContextSet = class std::__1::set' + +To fix the error the double declaration of ContextSet is removed. + +Bug: angleproject:5878, chromium:819294 +Change-Id: Id9e52061af53ea18dd5d13b960daaa67a14f61ca +Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3038804 +Reviewed-by: Jamie Madill +Commit-Queue: Jamie Madill +--- + +diff --git a/third_party/angle/CONTRIBUTORS b/third_party/angle/CONTRIBUTORS +index 887ddc2..94b1b4d 100644 +--- a/third_party/angle/CONTRIBUTORS ++++ b/third_party/angle/CONTRIBUTORS +@@ -154,6 +154,7 @@ + + LG Electronics, Inc. + Jani Hautakangas ++ Ivan Murashov + + IBM Inc. + Junliang Yan +diff --git a/third_party/angle/src/libANGLE/Display.h b/third_party/angle/src/libANGLE/Display.h +index f33123b..f0c0910 100644 +--- a/third_party/angle/src/libANGLE/Display.h ++++ b/third_party/angle/src/libANGLE/Display.h +@@ -322,7 +322,6 @@ + + ConfigSet mConfigSet; + +- typedef std::set ContextSet; + ContextSet mContextSet; + + typedef std::set ImageSet; diff --git a/chromium-93-DevToolsEmbedderMessageDispatcher-include.patch b/chromium-93-DevToolsEmbedderMessageDispatcher-include.patch new file mode 100644 index 0000000..dae81c0 --- /dev/null +++ b/chromium-93-DevToolsEmbedderMessageDispatcher-include.patch @@ -0,0 +1,24 @@ +From 409859ad9ba763a4267fb3457df7cd8eb0b7387b Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Sun, 25 Jul 2021 19:43:45 +0000 +Subject: [PATCH] IWYU: add vector for std::vector + +--- + chrome/browser/devtools/devtools_embedder_message_dispatcher.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/chrome/browser/devtools/devtools_embedder_message_dispatcher.h b/chrome/browser/devtools/devtools_embedder_message_dispatcher.h +index 12f8500..4007112 100644 +--- a/chrome/browser/devtools/devtools_embedder_message_dispatcher.h ++++ b/chrome/browser/devtools/devtools_embedder_message_dispatcher.h +@@ -8,6 +8,7 @@ + #include + #include + #include ++#include + + #include "base/callback.h" + #include "ui/gfx/geometry/insets.h" +-- +2.31.1 + diff --git a/chromium-93-FormForest-constexpr.patch b/chromium-93-FormForest-constexpr.patch new file mode 100644 index 0000000..56f7492 --- /dev/null +++ b/chromium-93-FormForest-constexpr.patch @@ -0,0 +1,49 @@ +From 802150d7be94e5317b257df545d55ce5b007ae65 Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz +Date: Tue, 20 Jul 2021 18:50:11 +0000 +Subject: [PATCH] libstdc++: do not use unique_ptr bool() operator in a constexpr in form_forest.h + +Fix build breakage in GCC, because of calling non constexpr functions from a +constexpr function. In this case, libstdc++ unique_ptr bool() operator is not +constexpr, so it cannot be used inside CompareByFrameToken. + +An example of build breakage caused by this: + ../../components/autofill/content/browser/form_forest.h:157:21: error: call to non-‘constexpr’ function ‘std::unique_ptr<_Tp, _Dp>::operator bool() const [with _Tp = autofill::internal::FormForest::FrameData; _Dp = std::default_delete]’ + 157 | return f && g ? f->frame_token < g->frame_token : f.get() < g.get(); + | ^ + +Bug: 957519 +Change-Id: I3c49559084fe58886a03520729873b7c4ac89bbf +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3041050 +Commit-Queue: Dominic Battré +Reviewed-by: Dominic Battré +Cr-Commit-Position: refs/heads/master@{#903595} +--- + +diff --git a/components/autofill/content/browser/form_forest.h b/components/autofill/content/browser/form_forest.h +index c89a8eb..f414ab8 100644 +--- a/components/autofill/content/browser/form_forest.h ++++ b/components/autofill/content/browser/form_forest.h +@@ -152,16 +152,16 @@ + // used by FrameData sets. + struct CompareByFrameToken { + using is_transparent = void; +- constexpr bool operator()(const std::unique_ptr& f, +- const std::unique_ptr& g) const { ++ bool operator()(const std::unique_ptr& f, ++ const std::unique_ptr& g) const { + return f && g ? f->frame_token < g->frame_token : f.get() < g.get(); + } +- constexpr bool operator()(const std::unique_ptr& f, +- const LocalFrameToken& g) const { ++ bool operator()(const std::unique_ptr& f, ++ const LocalFrameToken& g) const { + return f ? f->frame_token < g : true; + } +- constexpr bool operator()(const LocalFrameToken& f, +- const std::unique_ptr& g) const { ++ bool operator()(const LocalFrameToken& f, ++ const std::unique_ptr& g) const { + return g ? f < g->frame_token : false; + } + }; diff --git a/chromium-93-HashPasswordManager-include.patch b/chromium-93-HashPasswordManager-include.patch new file mode 100644 index 0000000..7e9f386 --- /dev/null +++ b/chromium-93-HashPasswordManager-include.patch @@ -0,0 +1,30 @@ +From 17d0e3dfcd0690df0e7b212fedcb95402f16935d Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz +Date: Fri, 23 Jul 2021 10:17:49 +0000 +Subject: [PATCH] IWYU: missing include for using std::vector in hash password manager. + +Fix build breakage: +../../components/password_manager/core/browser/hash_password_manager.h:44:8: error: ‘vector’ in namespace ‘std’ does not name a template type + 44 | std::vector RetrieveAllPasswordHashes(); + | ^~~~~~ + +Bug: 819294 +Change-Id: I8c8a4ec3972eedb87a312c5ec56adf4a21b1b2a2 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3041046 +Commit-Queue: Vasilii Sukhanov +Reviewed-by: Vasilii Sukhanov +Cr-Commit-Position: refs/heads/master@{#904696} +--- + +diff --git a/components/password_manager/core/browser/hash_password_manager.h b/components/password_manager/core/browser/hash_password_manager.h +index c762c5a..85e656ed 100644 +--- a/components/password_manager/core/browser/hash_password_manager.h ++++ b/components/password_manager/core/browser/hash_password_manager.h +@@ -6,6 +6,7 @@ + #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_HASH_PASSWORD_MANAGER_H_ + + #include ++#include + + #include "base/callback.h" + #include "base/callback_list.h" diff --git a/chromium-93-ScopedTestDialogAutoConfirm-include.patch b/chromium-93-ScopedTestDialogAutoConfirm-include.patch new file mode 100644 index 0000000..1ff0673 --- /dev/null +++ b/chromium-93-ScopedTestDialogAutoConfirm-include.patch @@ -0,0 +1,24 @@ +From 92fc089d50fc81b9903cd0573c95749e41081474 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Sun, 25 Jul 2021 21:38:26 +0000 +Subject: [PATCH] IWYU: add cstring for std::strcpy + +--- + extensions/browser/extension_dialog_auto_confirm.cc | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/extensions/browser/extension_dialog_auto_confirm.cc b/extensions/browser/extension_dialog_auto_confirm.cc +index adb4ac3..be8b161 100644 +--- a/extensions/browser/extension_dialog_auto_confirm.cc ++++ b/extensions/browser/extension_dialog_auto_confirm.cc +@@ -4,6 +4,7 @@ + + #include "extensions/browser/extension_dialog_auto_confirm.h" + ++#include + #include + + #include "base/check.h" +-- +2.31.1 + diff --git a/chromium-93-pdfium-include.patch b/chromium-93-pdfium-include.patch new file mode 100644 index 0000000..72f2abd --- /dev/null +++ b/chromium-93-pdfium-include.patch @@ -0,0 +1,117 @@ +From 7a6289c5ace52cf88f0e19caa5f78b7c15d0e7a6 Mon Sep 17 00:00:00 2001 +From: Miklos Vajna +Date: Wed, 21 Jul 2021 17:42:30 +0000 +Subject: [PATCH] fxcodec, fxge: fix missing includes with libstdc++ + +These missing includes break the build with gcc/libstdc++, they were not +a problem in practice with clang/libc++. + +Change-Id: I40013f97ba7ab06f32aa59f87b04aec06a19478c +Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/83210 +Commit-Queue: Lei Zhang +Reviewed-by: Lei Zhang +--- + +diff --git a/third_party/pdfium/core/fxcodec/jpeg/jpegmodule.cpp b/third_party/pdfium/core/fxcodec/jpeg/jpegmodule.cpp +index cea0679..036f250 100644 +--- a/third_party/pdfium/core/fxcodec/jpeg/jpegmodule.cpp ++++ b/third_party/pdfium/core/fxcodec/jpeg/jpegmodule.cpp +@@ -7,6 +7,7 @@ + #include "core/fxcodec/jpeg/jpegmodule.h" + + #include ++#include + + #include + #include +diff --git a/third_party/pdfium/core/fxcodec/jpx/cjpx_decoder.cpp b/third_party/pdfium/core/fxcodec/jpx/cjpx_decoder.cpp +index c66985a..9c1122b 100644 +--- a/third_party/pdfium/core/fxcodec/jpx/cjpx_decoder.cpp ++++ b/third_party/pdfium/core/fxcodec/jpx/cjpx_decoder.cpp +@@ -6,6 +6,8 @@ + + #include "core/fxcodec/jpx/cjpx_decoder.h" + ++#include ++ + #include + #include + #include +diff --git a/third_party/pdfium/core/fxge/cfx_cliprgn.cpp b/third_party/pdfium/core/fxge/cfx_cliprgn.cpp +index 5369d52..d198852 100644 +--- a/third_party/pdfium/core/fxge/cfx_cliprgn.cpp ++++ b/third_party/pdfium/core/fxge/cfx_cliprgn.cpp +@@ -6,6 +6,8 @@ + + #include "core/fxge/cfx_cliprgn.h" + ++#include ++ + #include + + #include "core/fxge/dib/cfx_dibitmap.h" +diff --git a/third_party/pdfium/core/fxge/dib/cfx_bitmapcomposer.cpp b/third_party/pdfium/core/fxge/dib/cfx_bitmapcomposer.cpp +index 6f9b420..0f1ffae 100644 +--- a/third_party/pdfium/core/fxge/dib/cfx_bitmapcomposer.cpp ++++ b/third_party/pdfium/core/fxge/dib/cfx_bitmapcomposer.cpp +@@ -6,6 +6,8 @@ + + #include "core/fxge/dib/cfx_bitmapcomposer.h" + ++#include ++ + #include "core/fxge/cfx_cliprgn.h" + #include "core/fxge/dib/cfx_dibitmap.h" + +diff --git a/third_party/pdfium/core/fxge/dib/cfx_bitmapstorer.cpp b/third_party/pdfium/core/fxge/dib/cfx_bitmapstorer.cpp +index f57c00e..45a0a18 100644 +--- a/third_party/pdfium/core/fxge/dib/cfx_bitmapstorer.cpp ++++ b/third_party/pdfium/core/fxge/dib/cfx_bitmapstorer.cpp +@@ -6,6 +6,8 @@ + + #include "core/fxge/dib/cfx_bitmapstorer.h" + ++#include ++ + #include + + #include "core/fxge/dib/cfx_dibitmap.h" +diff --git a/third_party/pdfium/core/fxge/dib/cfx_dibbase.cpp b/third_party/pdfium/core/fxge/dib/cfx_dibbase.cpp +index 4ec0ddb..a1de2fb 100644 +--- a/third_party/pdfium/core/fxge/dib/cfx_dibbase.cpp ++++ b/third_party/pdfium/core/fxge/dib/cfx_dibbase.cpp +@@ -6,6 +6,8 @@ + + #include "core/fxge/dib/cfx_dibbase.h" + ++#include ++ + #include + #include + #include +diff --git a/third_party/pdfium/core/fxge/dib/cfx_dibitmap.cpp b/third_party/pdfium/core/fxge/dib/cfx_dibitmap.cpp +index d7ccf6c..94e8acc 100644 +--- a/third_party/pdfium/core/fxge/dib/cfx_dibitmap.cpp ++++ b/third_party/pdfium/core/fxge/dib/cfx_dibitmap.cpp +@@ -6,6 +6,8 @@ + + #include "core/fxge/dib/cfx_dibitmap.h" + ++#include ++ + #include + #include + #include +diff --git a/third_party/pdfium/core/fxge/dib/cfx_scanlinecompositor.cpp b/third_party/pdfium/core/fxge/dib/cfx_scanlinecompositor.cpp +index e8362d7..c04c6dc 100644 +--- a/third_party/pdfium/core/fxge/dib/cfx_scanlinecompositor.cpp ++++ b/third_party/pdfium/core/fxge/dib/cfx_scanlinecompositor.cpp +@@ -6,6 +6,8 @@ + + #include "core/fxge/dib/cfx_scanlinecompositor.h" + ++#include ++ + #include + + #include "core/fxge/dib/fx_dib.h" diff --git a/chromium-93.0.4577.63-clang-format.patch b/chromium-93.0.4577.63-clang-format.patch new file mode 100644 index 0000000..77e842e --- /dev/null +++ b/chromium-93.0.4577.63-clang-format.patch @@ -0,0 +1,34 @@ +diff -up chromium-93.0.4577.63/buildtools/linux64/clang-format.clang-format-py3 chromium-93.0.4577.63/buildtools/linux64/clang-format +--- chromium-93.0.4577.63/buildtools/linux64/clang-format.clang-format-py3 2021-09-03 04:42:46.736294345 +0000 ++++ chromium-93.0.4577.63/buildtools/linux64/clang-format 2021-09-03 04:59:55.296512600 +0000 +@@ -10,9 +10,9 @@ import sys + args = sys.argv[1:] + inputfiles = [a for a in args if not a.startswith('-')] + +-contents = '' ++contents = b'' + if '-' in args or not inputfiles: +- contents = sys.stdin.read() ++ contents = sys.stdin.buffer.read() + + # Tarball builds may or may not have depot_tools in $PATH. In the former case, + # running 'clang-format' will call back into this script infinitely. Strip off +@@ -34,14 +34,14 @@ try: + stdout, stderr = proc.communicate(input=contents) + # Ignore if clang-format fails. Eg: it may be too old to support C++14. + if proc.returncode == 0: +- sys.stdout.write(stdout) +- sys.stderr.write(stderr) ++ sys.stdout.buffer.write(stdout) ++ sys.stderr.buffer.write(stderr) + sys.exit(0) + except OSError: + # Ignore if clang-format is not installed. + pass + + # If any failure happens, continue with unformatted files. +-sys.stdout.write(contents) ++sys.stdout.buffer.write(contents) + for inputfile in inputfiles: +- sys.stdout.write(open(inputfile).read()) ++ sys.stdout.buffer.write(open(inputfile).read()) diff --git a/chromium-93.0.4577.63-freetype-2.11.patch b/chromium-93.0.4577.63-freetype-2.11.patch new file mode 100644 index 0000000..0c0e95e --- /dev/null +++ b/chromium-93.0.4577.63-freetype-2.11.patch @@ -0,0 +1,52 @@ +diff -up chromium-93.0.4577.63/third_party/skia/src/ports/SkFontHost_FreeType_common.cpp.freetype-2.11 chromium-93.0.4577.63/third_party/skia/src/ports/SkFontHost_FreeType_common.cpp +--- chromium-93.0.4577.63/third_party/skia/src/ports/SkFontHost_FreeType_common.cpp.freetype-2.11 2021-09-02 08:49:18.996863417 -0400 ++++ chromium-93.0.4577.63/third_party/skia/src/ports/SkFontHost_FreeType_common.cpp 2021-09-02 08:56:07.716626801 -0400 +@@ -712,7 +712,11 @@ void colrv1_draw_paint(SkCanvas* canvas, + canvas->drawPaint(colrPaint); + break; + } ++#if FREETYPE_MAJOR == 2 && FREETYPE_MINOR >= 11 + case FT_COLR_PAINTFORMAT_TRANSFORM: ++#else ++ case FT_COLR_PAINTFORMAT_TRANSFORMED: ++#endif + case FT_COLR_PAINTFORMAT_TRANSLATE: + case FT_COLR_PAINTFORMAT_SCALE: + case FT_COLR_PAINTFORMAT_ROTATE: +@@ -760,10 +764,17 @@ void colrv1_transform(SkCanvas* canvas, + SkMatrix transform; + + switch (colrv1_paint.format) { ++#if FREETYPE_MAJOR == 2 && FREETYPE_MINOR >= 11 + case FT_COLR_PAINTFORMAT_TRANSFORM: { + transform = ToSkMatrix(colrv1_paint.u.transform.affine); + break; + } ++#else ++ case FT_COLR_PAINTFORMAT_TRANSFORMED: { ++ transform = ToSkMatrix(colrv1_paint.u.transformed.affine); ++ break; ++ } ++#endif + case FT_COLR_PAINTFORMAT_TRANSLATE: { + transform = SkMatrix::Translate( + SkFixedToScalar(colrv1_paint.u.translate.dx), +@@ -889,11 +900,18 @@ bool colrv1_traverse_paint(SkCanvas* can + traverse_result = colrv1_start_glyph(canvas, palette, face, paint.u.colr_glyph.glyphID, + FT_COLOR_NO_ROOT_TRANSFORM); + break; ++#if FREETYPE_MAJOR == 2 && FREETYPE_MINOR >= 11 + case FT_COLR_PAINTFORMAT_TRANSFORM: + colrv1_transform(canvas, face, paint); + traverse_result = colrv1_traverse_paint(canvas, palette, face, + paint.u.transform.paint, visited_set); + break; ++#else ++ case FT_COLR_PAINTFORMAT_TRANSFORMED: ++ colrv1_transform(canvas, face, paint); ++ traverse_result = colrv1_traverse_paint(canvas, palette, face, ++ paint.u.transformed.paint, visited_set); ++#endif + case FT_COLR_PAINTFORMAT_TRANSLATE: + colrv1_transform(canvas, face, paint); + traverse_result = colrv1_traverse_paint(canvas, palette, face, diff --git a/chromium-93.0.4577.63-missing-cstring.patch b/chromium-93.0.4577.63-missing-cstring.patch new file mode 100644 index 0000000..47699a3 --- /dev/null +++ b/chromium-93.0.4577.63-missing-cstring.patch @@ -0,0 +1,45 @@ +diff -up chromium-93.0.4577.63/net/base/test_data_stream.cc.missing-cstring chromium-93.0.4577.63/net/base/test_data_stream.cc +--- chromium-93.0.4577.63/net/base/test_data_stream.cc.missing-cstring 2021-09-03 13:59:54.051831465 +0000 ++++ chromium-93.0.4577.63/net/base/test_data_stream.cc 2021-09-03 14:00:05.448414041 +0000 +@@ -5,6 +5,7 @@ + #include "net/base/test_data_stream.h" + + #include ++#include + + namespace net { + +diff -up chromium-93.0.4577.63/third_party/webrtc/audio/utility/channel_mixer.cc.missing-cstring chromium-93.0.4577.63/third_party/webrtc/audio/utility/channel_mixer.cc +--- chromium-93.0.4577.63/third_party/webrtc/audio/utility/channel_mixer.cc.missing-cstring 2021-09-03 12:29:44.105246962 +0000 ++++ chromium-93.0.4577.63/third_party/webrtc/audio/utility/channel_mixer.cc 2021-09-03 12:29:44.106246925 +0000 +@@ -8,6 +8,8 @@ + * be found in the AUTHORS file in the root of the source tree. + */ + ++#include ++ + #include "audio/utility/channel_mixer.h" + + #include "audio/utility/channel_mixing_matrix.h" +diff -up chromium-93.0.4577.63/third_party/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc.missing-cstring chromium-93.0.4577.63/third_party/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc +--- chromium-93.0.4577.63/third_party/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc.missing-cstring 2021-09-03 12:29:43.585266089 +0000 ++++ chromium-93.0.4577.63/third_party/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc 2021-09-03 12:29:43.585266089 +0000 +@@ -23,6 +23,7 @@ + #include + #include + ++#include + #include + #include + +diff -up chromium-93.0.4577.63/third_party/webrtc/modules/video_coding/utility/ivf_file_reader.cc.missing-cstring chromium-93.0.4577.63/third_party/webrtc/modules/video_coding/utility/ivf_file_reader.cc +--- chromium-93.0.4577.63/third_party/webrtc/modules/video_coding/utility/ivf_file_reader.cc.missing-cstring 2021-09-03 12:29:43.275277492 +0000 ++++ chromium-93.0.4577.63/third_party/webrtc/modules/video_coding/utility/ivf_file_reader.cc 2021-09-03 12:29:43.273277565 +0000 +@@ -10,6 +10,7 @@ + + #include "modules/video_coding/utility/ivf_file_reader.h" + ++#include + #include + #include + diff --git a/chromium-93.0.4577.63-mojo-header-fix.patch b/chromium-93.0.4577.63-mojo-header-fix.patch new file mode 100644 index 0000000..edd66ef --- /dev/null +++ b/chromium-93.0.4577.63-mojo-header-fix.patch @@ -0,0 +1,12 @@ +diff -up chromium-93.0.4577.63/services/network/test/test_url_loader_factory.h.mojo-header-fix chromium-93.0.4577.63/services/network/test/test_url_loader_factory.h +--- chromium-93.0.4577.63/services/network/test/test_url_loader_factory.h.mojo-header-fix 2021-09-03 17:22:17.902206557 +0000 ++++ chromium-93.0.4577.63/services/network/test/test_url_loader_factory.h 2021-09-03 17:22:31.853693947 +0000 +@@ -19,7 +19,7 @@ + #include "services/network/public/cpp/resource_request.h" + #include "services/network/public/mojom/url_loader.mojom.h" + #include "services/network/public/mojom/url_loader_factory.mojom.h" +-#include "services/network/public/mojom/url_response_head.mojom-forward.h" ++#include "services/network/public/mojom/url_response_head.mojom.h" + + namespace network { + class WeakWrapperSharedURLLoaderFactory; diff --git a/chromium-93.0.4577.63-norar.patch b/chromium-93.0.4577.63-norar.patch new file mode 100644 index 0000000..5b453ca --- /dev/null +++ b/chromium-93.0.4577.63-norar.patch @@ -0,0 +1,90 @@ +diff -up chromium-93.0.4577.63/chrome/common/safe_browsing/BUILD.gn.nounrar chromium-93.0.4577.63/chrome/common/safe_browsing/BUILD.gn +--- chromium-93.0.4577.63/chrome/common/safe_browsing/BUILD.gn.nounrar 2021-09-02 08:22:31.280927364 -0400 ++++ chromium-93.0.4577.63/chrome/common/safe_browsing/BUILD.gn 2021-09-02 08:23:32.143189935 -0400 +@@ -43,39 +43,6 @@ if (safe_browsing_mode == 1) { + public_deps = [ "//components/safe_browsing/core/common/proto:csd_proto" ] + } + +- source_set("rar_analyzer") { +- sources = [ +- "rar_analyzer.cc", +- "rar_analyzer.h", +- ] +- +- deps = [ +- ":archive_analyzer_results", +- ":download_type_util", +- "//base", +- "//base:i18n", +- "//components/safe_browsing/content/common:file_type_policies", +- "//components/safe_browsing/core/common", +- "//third_party/unrar:unrar", +- ] +- +- defines = [ +- "_FILE_OFFSET_BITS=64", +- "LARGEFILE_SOURCE", +- "RAR_SMP", +- "SILENT", +- +- # The following is set to disable certain macro definitions in the unrar +- # source code. +- "CHROMIUM_UNRAR", +- +- # Disables exceptions in unrar, replaces them with process termination. +- "UNRAR_NO_EXCEPTIONS", +- ] +- +- public_deps = [ "//components/safe_browsing/core/common/proto:csd_proto" ] +- } +- + if (is_mac) { + source_set("disk_image_type_sniffer_mac") { + sources = [ +@@ -149,7 +116,6 @@ source_set("safe_browsing") { + ":archive_analyzer_results", + ":binary_feature_extractor", + ":download_type_util", +- ":rar_analyzer", + "//components/safe_browsing/core/common", + ] + +diff -up chromium-93.0.4577.63/chrome/common/safe_browsing/DEPS.nounrar chromium-93.0.4577.63/chrome/common/safe_browsing/DEPS +--- chromium-93.0.4577.63/chrome/common/safe_browsing/DEPS.nounrar 2021-09-02 08:22:31.280927364 -0400 ++++ chromium-93.0.4577.63/chrome/common/safe_browsing/DEPS 2021-09-02 08:23:56.092293262 -0400 +@@ -2,6 +2,5 @@ include_rules = [ + "+components/safe_browsing/content/common", + "+components/safe_browsing/core/common", + "+third_party/protobuf", +- "+third_party/unrar", + "+third_party/zlib", + ] +diff -up chromium-93.0.4577.63/chrome/services/file_util/BUILD.gn.nounrar chromium-93.0.4577.63/chrome/services/file_util/BUILD.gn +--- chromium-93.0.4577.63/chrome/services/file_util/BUILD.gn.nounrar 2021-08-31 21:39:29.000000000 -0400 ++++ chromium-93.0.4577.63/chrome/services/file_util/BUILD.gn 2021-09-02 08:22:31.280927364 -0400 +@@ -50,7 +50,6 @@ source_set("file_util") { + deps += [ + "//chrome/common/safe_browsing", + "//chrome/common/safe_browsing:archive_analyzer_results", +- "//chrome/common/safe_browsing:rar_analyzer", + ] + } + +diff -up chromium-93.0.4577.63/chrome/services/file_util/safe_archive_analyzer.cc.nounrar chromium-93.0.4577.63/chrome/services/file_util/safe_archive_analyzer.cc +--- chromium-93.0.4577.63/chrome/services/file_util/safe_archive_analyzer.cc.nounrar 2021-08-31 21:39:29.000000000 -0400 ++++ chromium-93.0.4577.63/chrome/services/file_util/safe_archive_analyzer.cc 2021-09-02 08:22:31.281927369 -0400 +@@ -45,10 +45,14 @@ void SafeArchiveAnalyzer::AnalyzeDmgFile + void SafeArchiveAnalyzer::AnalyzeRarFile(base::File rar_file, + base::File temporary_file, + AnalyzeRarFileCallback callback) { ++#if 0 + DCHECK(rar_file.IsValid()); + + safe_browsing::ArchiveAnalyzerResults results; + safe_browsing::rar_analyzer::AnalyzeRarFile( + std::move(rar_file), std::move(temporary_file), &results); + std::move(callback).Run(results); ++#else ++ NOTREACHED(); ++#endif + } diff --git a/chromium-93.0.4577.63-py3-bootstrap.patch b/chromium-93.0.4577.63-py3-bootstrap.patch new file mode 100644 index 0000000..899495f --- /dev/null +++ b/chromium-93.0.4577.63-py3-bootstrap.patch @@ -0,0 +1,12 @@ +diff -up chromium-93.0.4577.63/tools/gn/bootstrap/bootstrap.py.py3 chromium-93.0.4577.63/tools/gn/bootstrap/bootstrap.py +--- chromium-93.0.4577.63/tools/gn/bootstrap/bootstrap.py.py3 2021-08-31 21:40:34.000000000 -0400 ++++ chromium-93.0.4577.63/tools/gn/bootstrap/bootstrap.py 2021-09-02 08:26:04.415846917 -0400 +@@ -130,7 +130,7 @@ def main(argv): + if not options.debug: + gn_gen_args += ' is_debug=false' + subprocess.check_call([ +- gn_path, 'gen', out_dir, ++ gn_path, 'gen', out_dir, ' --script-executable=/usr/bin/python3', + '--args=%s' % gn_gen_args, "--root=" + SRC_ROOT + ]) + diff --git a/chromium-93.0.4577.63-remoting-nodestructor-fix.patch b/chromium-93.0.4577.63-remoting-nodestructor-fix.patch new file mode 100644 index 0000000..6f2e419 --- /dev/null +++ b/chromium-93.0.4577.63-remoting-nodestructor-fix.patch @@ -0,0 +1,21 @@ +diff -up chromium-93.0.4577.63/remoting/host/remote_open_url_client.cc.remoting-nodestructor-fix chromium-93.0.4577.63/remoting/host/remote_open_url_client.cc +--- chromium-93.0.4577.63/remoting/host/remote_open_url_client.cc.remoting-nodestructor-fix 2021-09-03 17:30:44.162605313 +0000 ++++ chromium-93.0.4577.63/remoting/host/remote_open_url_client.cc 2021-09-03 17:31:01.017986003 +0000 +@@ -56,7 +56,7 @@ void ShowMessageDialog(const std::string + } + + bool IsBrowserValid(const std::string& browser) { +- static const base::NoDestructor> invalid_browsers( ++ static const base::NoDestructor> invalid_browsers{ + { + // This is the chromoting forwarder itself. + "crd-url-forwarder.desktop", +@@ -64,7 +64,7 @@ bool IsBrowserValid(const std::string& b + // XFCE's forwarder. May potentially launch the chromoting forwarder + // recursively. + "xfce4-web-browser.desktop", +- }); ++ }}; + if (browser.empty()) { + return false; + } diff --git a/chromium-93.0.4577.63-vector-fix.patch b/chromium-93.0.4577.63-vector-fix.patch new file mode 100644 index 0000000..00e7d62 --- /dev/null +++ b/chromium-93.0.4577.63-vector-fix.patch @@ -0,0 +1,11 @@ +diff -up chromium-93.0.4577.63/components/cast_channel/enum_table.h.vector-fix chromium-93.0.4577.63/components/cast_channel/enum_table.h +--- chromium-93.0.4577.63/components/cast_channel/enum_table.h.vector-fix 2021-09-03 12:23:37.974714814 +0000 ++++ chromium-93.0.4577.63/components/cast_channel/enum_table.h 2021-09-03 12:23:51.330223540 +0000 +@@ -8,6 +8,7 @@ + #include + #include + #include ++#include + + #include "base/check_op.h" + #include "base/macros.h" diff --git a/chromium-93.0.4577.63-widevine-no-download.patch b/chromium-93.0.4577.63-widevine-no-download.patch new file mode 100644 index 0000000..1266e51 --- /dev/null +++ b/chromium-93.0.4577.63-widevine-no-download.patch @@ -0,0 +1,14 @@ +diff -up chromium-93.0.4577.63/chrome/browser/component_updater/registration.cc.widevine-no-download chromium-93.0.4577.63/chrome/browser/component_updater/registration.cc +--- chromium-93.0.4577.63/chrome/browser/component_updater/registration.cc.widevine-no-download 2021-09-02 08:37:03.910692041 -0400 ++++ chromium-93.0.4577.63/chrome/browser/component_updater/registration.cc 2021-09-02 08:45:07.446778150 -0400 +@@ -118,10 +118,6 @@ void RegisterComponentsForUpdate(bool is + RegisterMediaFoundationWidevineCdmComponent(cus); + #endif + +-#if BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT) +- RegisterWidevineCdmComponent(cus); +-#endif // BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT) +- + #if BUILDFLAG(ENABLE_NACL) && !defined(OS_ANDROID) + #if BUILDFLAG(IS_CHROMEOS_ASH) + // PNaCl on Chrome OS is on rootfs and there is no need to download it. But diff --git a/chromium.spec b/chromium.spec index f7981ef..088e026 100644 --- a/chromium.spec +++ b/chromium.spec @@ -7,7 +7,7 @@ # This flag is so I can build things very fast on a giant system. # Do not enable in Koji builds. -%global use_all_cpus 0 +%global use_all_cpus 1 %if %{use_all_cpus} %global numjobs %{_smp_build_ncpus} @@ -31,8 +31,7 @@ # This doesn't work and it doesn't even build as of Chromium 83 %global build_remoting 1 -# This will probably be truely possible with Chromium 93 -# Right now, we fake it a bit and pull in both python2 and python3 stacks. sorry. +# This is finally possible with Chromium 93 %global build_with_python3 1 %if 0%{?build_with_python3} @@ -140,7 +139,7 @@ BuildRequires: libicu-devel >= 5.4 # Fedora's Python 2 stack is being removed, we use the bundled Python libraries # This can be revisited once we upgrade to Python 3 -%global bundlepylibs 1 +%global bundlepylibs 0 # RHEL 7.9 dropped minizip. # It exists everywhere else though. @@ -218,15 +217,15 @@ BuildRequires: libicu-devel >= 5.4 %global chromoting_client_id %nil %endif -%global majorversion 92 +%global majorversion 93 %if %{freeworld} Name: chromium%{chromium_channel}%{nsuffix} %else Name: chromium%{chromium_channel} %endif -Version: %{majorversion}.0.4515.159 -Release: 2%{?dist} +Version: %{majorversion}.0.4577.63 +Release: 1%{?dist} %if %{?freeworld} %if %{?shared} # chromium-libs-media-freeworld @@ -254,7 +253,7 @@ Patch4: chromium-60.0.3112.78-jpeg-nomangle.patch # Do not mangle zlib Patch5: chromium-77.0.3865.75-no-zlib-mangle.patch # Do not use unrar code, it is non-free -Patch6: chromium-92.0.4515.107-norar.patch +Patch6: chromium-93.0.4577.63-norar.patch # Use Gentoo's Widevine hack # https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/files/chromium-widevine-r3.patch Patch7: chromium-71.0.3578.98-widevine-r3.patch @@ -264,9 +263,9 @@ Patch8: chromium-91.0.4472.77-disable-fontconfig-cache-magic.patch Patch9: chromium-78.0.3904.70-gcc9-drop-rsp-clobber.patch # Try to load widevine from other places Patch10: chromium-92.0.4515.107-widevine-other-locations.patch -# Try to fix version.py for Rawhide +# Tell bootstrap.py to always use the version of Python we specify %if 0%{?build_with_python3} -Patch11: chromium-92.0.4515.107-py3-bootstrap.patch +Patch11: chromium-93.0.4577.63-py3-bootstrap.patch %else Patch11: chromium-92.0.4515.107-py2-bootstrap.patch %endif @@ -284,7 +283,7 @@ Patch55: chromium-78-protobuf-RepeatedPtrField-export.patch # ../../third_party/perfetto/include/perfetto/base/task_runner.h:48:55: error: 'uint32_t' has not been declared Patch56: chromium-80.0.3987.87-missing-cstdint-header.patch # Missing (thanks c++17) -Patch57: chromium-89.0.4389.72-missing-cstring-header.patch +Patch57: chromium-93.0.4577.63-missing-cstring.patch # prepare for using system ffmpeg (clean) # http://svnweb.mageia.org/packages/cauldron/chromium-browser-stable/current/SOURCES/chromium-53-ffmpeg-no-deprecation-errors.patch?view=markup Patch58: chromium-53-ffmpeg-no-deprecation-errors.patch @@ -314,26 +313,45 @@ Patch68: chromium-84.0.4147.125-aarch64-clearkeycdm-binutils-workaround.patch Patch75: chromium-90.0.4430.72-fstatfix.patch # Rawhide (f35) glibc defines SIGSTKSZ as a long instead of a constant Patch76: chromium-92.0.4515.107-rawhide-gcc-std-max-fix.patch -# Fix symbol visibility with gcc on swiftshader's libEGL -Patch77: chromium-88.0.4324.182-gcc-fix-swiftshader-libEGL-visibility.patch # Do not download proprietary widevine module in the background (thanks Debian) -Patch79: chromium-90.0.4430.72-widevine-no-download.patch +Patch79: chromium-93.0.4577.63-widevine-no-download.patch # Fix crashes with components/cast_* # Thanks to Gentoo Patch80: chromium-92.0.4515.107-EnumTable-crash.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-92-v8-constexpr.patch -Patch82: chromium-92-v8-constexpr.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-93-BluetoothLowEnergyScanFilter-include.patch +Patch81: chromium-93-BluetoothLowEnergyScanFilter-include.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-93-ClassProperty-include.patch +Patch82: chromium-93-ClassProperty-include.patch # Fixes for python3 Patch83: chromium-92.0.4515.107-py3-fixes.patch -# Fix build with Freetype 2.11 -Patch84: https://gitweb.gentoo.org/repo/gentoo.git/plain/www-client/chromium/files/chromium-freetype-2.11.patch -# https://bugs.chromium.org/p/chromium/issues/detail?id=1213452 -# https://chromium.googlesource.com/chromium/src/sandbox/+/482404adee4fc0487452c7ae5ac9c192b0f4fd30%5E%21/#F0 -# Needed for F35+, but safe everywhere (except epel8 which is too old to know about __NR_clone3) -Patch85: chromium-92.0.4515.107-sandbox-clone3.patch +# Support older freetype than 2.11 (for epel8) +Patch84: chromium-93.0.4577.63-freetype-2.11.patch # Clean up clang-format for python3 # thanks to Jon Nettleton -Patch86: chromium-92-clang-format.patch +Patch86: chromium-93.0.4577.63-clang-format.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-93-ContextSet-permissive.patch +Patch87: chromium-93-ContextSet-permissive.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-93-DevToolsEmbedderMessageDispatcher-include.patch +Patch88: chromium-93-DevToolsEmbedderMessageDispatcher-include.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-93-FormForest-constexpr.patch +Patch89: chromium-93-FormForest-constexpr.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-93-HashPasswordManager-include.patch +Patch90: chromium-93-HashPasswordManager-include.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-93-pdfium-include.patch +Patch91: chromium-93-pdfium-include.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-93-ScopedTestDialogAutoConfirm-include.patch +Patch92: chromium-93-ScopedTestDialogAutoConfirm-include.patch +# In file included from ../../components/cast_channel/enum_table.cc:5: +# ../../components/cast_channel/enum_table.h:359:18: error: 'vector' in namespace 'std' does not name a template type +# 359 | const std::vector data_; +# | ^~~~~~ +# ../../components/cast_channel/enum_table.h:18:1: note: 'std::vector' is defined in header ''; did you forget to '#include '? +Patch93: chromium-93.0.4577.63-vector-fix.patch +# Fix NoDestructor issue with gcc +Patch94: chromium-93.0.4577.63-remoting-nodestructor-fix.patch +# include full UrlResponseHead header +Patch95: chromium-93.0.4577.63-mojo-header-fix.patch + # Use lstdc++ on EPEL7 only Patch101: chromium-75.0.3770.100-epel7-stdc++.patch @@ -556,13 +574,13 @@ BuildRequires: pkgconfig(gtk+-3.0) BuildRequires: pkgconfig(gtk+-2.0) %endif BuildRequires: %{chromium_pybin} -# %%if ! %%{build_with_python3} +%if ! %{build_with_python3} BuildRequires: python2-devel -# %%else +%else BuildRequires: python3-devel -# %%endif +%endif -# %%if 0%{?build_with_python3} +%if 0%{?build_with_python3} %if 0%{?bundlepylibs} # Using bundled bits, do nothing. %else @@ -581,7 +599,7 @@ BuildRequires: python-ply %endif BuildRequires: python3-simplejson %endif -#%%else +%else %if 0%{?bundlepylibs} # Using bundled bits, do nothing. %else @@ -600,7 +618,7 @@ BuildRequires: python-ply %endif BuildRequires: python2-simplejson %endif -# %%endif +%endif %if 0%{?bundlere2} @@ -1001,17 +1019,22 @@ udev. %if 0%{?fedora} >= 35 %patch76 -p1 -b .sigstkszfix %endif -%patch77 -p1 -b .gcc-swiftshader-visibility %patch79 -p1 -b .widevine-no-download %patch80 -p1 -b .EnumTable-crash -%patch82 -p1 -b .v8-constexpr +%patch81 -p1 -b .BluetoothLowEnergyScanFilter-include +%patch82 -p1 -b .ClassProperty-include %patch83 -p1 -b .py3fixes %patch84 -p1 -b .freetype-2.11 -%if 0%{?fedora} -%patch85 -p1 -b .clone3 -%endif -# Still using python2 in 92. -# %%patch86 -p1 -b .clang-format-py3 +%patch86 -p1 -b .clang-format-py3 +%patch87 -p1 -b .ContextSet-permissive +%patch88 -p1 -b .DevToolsEmbedderMessageDispatcher-include +%patch89 -p1 -b .FormForest-constexpr +%patch90 -p1 -b .HashPasswordManager-include +%patch91 -p1 -b .pdfium-include +%patch92 -p1 -b .ScopedTestDialogAutoConfirm-include +%patch93 -p1 -b .vector-fix +%patch94 -p1 -b .remoting-nodestructor-fix +%patch95 -p1 -b .mojo-header-fix # Fedora branded user agent %if 0%{?fedora} @@ -1247,7 +1270,6 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/angle/src/common/third_party/base' \ 'third_party/angle/src/common/third_party/smhasher' \ 'third_party/angle/src/common/third_party/xxhash' \ - 'third_party/angle/src/third_party/compiler' \ 'third_party/angle/src/third_party/libXNVCtrl' \ 'third_party/angle/src/third_party/trace_event' \ 'third_party/angle/src/third_party/volk' \ @@ -1286,6 +1308,7 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/dav1d' \ 'third_party/dawn' \ 'third_party/dawn/third_party/khronos' \ + 'third_party/dawn/third_party/tint' \ 'third_party/depot_tools' \ 'third_party/devscripts' \ 'third_party/devtools-frontend' \ @@ -1371,15 +1394,14 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/lss' \ 'third_party/lzma_sdk' \ 'third_party/mako' \ -%if 0%{?bundlepylibs} 'third_party/markupsafe' \ -%endif 'third_party/mesa' \ 'third_party/metrics_proto' \ 'third_party/minigbm' \ 'third_party/modp_b64' \ 'third_party/nasm' \ 'third_party/nearby' \ + 'third_party/neon_2_sse' \ 'third_party/node' \ 'third_party/node/node_modules/polymer-bundler/lib/third_party/UglifyJS2' \ 'third_party/one_euro_filter' \ @@ -1474,7 +1496,6 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/zlib' \ 'third_party/zlib/google' \ 'tools/gn/src/base/third_party/icu' \ - 'tools/grit/third_party/six' \ 'url/third_party/mozilla' \ 'v8/src/third_party/siphash' \ 'v8/src/third_party/utf8-decoder' \ @@ -1483,17 +1504,6 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'v8/third_party/inspector_protocol' \ --do-remove -%if ! 0%{?bundlepylibs} -# Look, I don't know. This package is spit and chewing gum. Sorry. -rm -rf third_party/markupsafe -%if 0%{?build_with_python3} -ln -s %{python3_sitearch}/markupsafe third_party/markupsafe -%else -ln -s %{python2_sitearch}/markupsafe third_party/markupsafe -%endif -# We should look on removing other python packages as well i.e. ply -%endif - # Fix hardcoded path in remoting code sed -i 's|/opt/google/chrome-remote-desktop|%{crd_path}|g' remoting/host/setup/daemon_controller_delegate_linux.cc @@ -1641,7 +1651,7 @@ tar xf %{SOURCE20} %endif # export PYTHONPATH="../../third_party/pyjson5/src:../../third_party/catapult/third_party/google-endpoints:../../xcb-proto-1.14" -export PYTHONPATH="../../third_party/pyjson5/src:../../xcb-proto-1.14" +export PYTHONPATH="../../third_party/pyjson5/src:../../xcb-proto-1.14:../../third_party/catapult/third_party/html5lib-1.1" echo # Now do the full browser @@ -2098,6 +2108,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Thu Sep 2 2021 Tom Callaway - 93.0.4577.63-1 +- update to 93.0.4577.63 + * Mon Aug 30 2021 Tom Callaway - 92.0.4515.159-2 - disable userfaultd code in epel8 - include crashpad_handler (it works a lot better when it doesn't immediately crash because of this missing file) diff --git a/clean_ffmpeg.sh b/clean_ffmpeg.sh index ac34ca2..518eb5e 100755 --- a/clean_ffmpeg.sh +++ b/clean_ffmpeg.sh @@ -236,6 +236,7 @@ manual_files=" libavcodec/aarch64/fft_neon.S \ libavcodec/hpeldsp.c \ libavcodec/mdct15.c \ libavcodec/mdct_template.c \ + libavcodec/options.c \ libavcodec/pel_template.c \ libavcodec/utils.c \ libavcodec/videodsp.c \ @@ -255,7 +256,9 @@ manual_files=" libavcodec/aarch64/fft_neon.S \ libavutil/fixed_dsp.c \ libavutil/float_dsp.c \ libavutil/imgutils.c \ + libavutil/tx_float.c \ libavutil/tx_template.c \ + libavutil/utils.c \ libavutil/x86/cpu.c \ libavutil/x86/float_dsp_init.c \ libavutil/x86/x86inc.asm \ @@ -276,7 +279,6 @@ mp3_files=" libavcodec/aarch64/aacpsdsp_init_aarch64.c \ libavcodec/aacsbr.c \ libavcodec/aactab.c \ libavcodec/ac3tab.c \ - libavcodec/autorename_libavcodec_aacdec.c \ libavcodec/autorename_libavcodec_mpegaudiodsp.c \ libavcodec/autorename_libavcodec_sbrdsp.c \ libavcodec/cbrt_data.c \ diff --git a/sources b/sources index aef7285..8bf3438 100644 --- a/sources +++ b/sources @@ -21,3 +21,4 @@ SHA512 (depot_tools.git-master.tar.gz) = dc323888812b66cc92c53a24a8a58ccf9e2961b SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1dc09f5a0fd7898e9d0a372ee4422b6b1cdab3c86ecc91db437e9ae8a951e64e85edc3ac9e9fca428852dbb2ad SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a SHA512 (chromium-92.0.4515.159-clean.tar.xz) = e5062c35c55232f672008d7c4a06daa69a92e0ed4104ea78e60280e2d7d20bcbf1b52c33229fd3b81983b02cbc949d188e5385b6250662248e11660d1fced31d +SHA512 (chromium-93.0.4577.63-clean.tar.xz) = a8d6ad79a52e2df7a12c5922df41855a70f6dddcb76ec5e25177d9b0d565634074de1d86fbc1f894be259f37736d44ee231567596d7a37de96de11a010f2c5d9 From 4bb9581dd3918d44ed90c29a2f54a2ff87333457 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Sat, 4 Sep 2021 16:25:32 -0400 Subject: [PATCH 031/659] drop unnecessary epel8 patch --- chromium-92.0.4515.159-epel8-uffd-off.patch | 12 ------------ chromium.spec | 3 --- sources | 1 - 3 files changed, 16 deletions(-) delete mode 100644 chromium-92.0.4515.159-epel8-uffd-off.patch diff --git a/chromium-92.0.4515.159-epel8-uffd-off.patch b/chromium-92.0.4515.159-epel8-uffd-off.patch deleted file mode 100644 index 553b9b0..0000000 --- a/chromium-92.0.4515.159-epel8-uffd-off.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up chromium-92.0.4515.159/base/allocator/partition_allocator/partition_alloc_config.h.epel8-uffd-off chromium-92.0.4515.159/base/allocator/partition_allocator/partition_alloc_config.h ---- chromium-92.0.4515.159/base/allocator/partition_allocator/partition_alloc_config.h.epel8-uffd-off 2021-08-30 09:25:56.878243728 -0400 -+++ chromium-92.0.4515.159/base/allocator/partition_allocator/partition_alloc_config.h 2021-08-30 09:26:12.489322762 -0400 -@@ -37,7 +37,7 @@ static_assert(sizeof(void*) != 8, ""); - #if defined(PA_HAS_64_BITS_POINTERS) && \ - (defined(OS_LINUX) || defined(OS_ANDROID)) - // TODO(bikineev): Enable for ChromeOS. --#define PA_STARSCAN_UFFD_WRITE_PROTECTOR_SUPPORTED -+// #define PA_STARSCAN_UFFD_WRITE_PROTECTOR_SUPPORTED - #endif - - // POSIX is not only UNIX, e.g. macOS and other OSes. We do use Linux-specific diff --git a/chromium.spec b/chromium.spec index 088e026..00646b5 100644 --- a/chromium.spec +++ b/chromium.spec @@ -378,8 +378,6 @@ Patch109: chromium-90.0.4430.93-epel7-erase-fix.patch # Again, not sure how epel8 is the only one to hit this... # AARCH64 neon symbols need to be prefixed too to prevent multiple definition issue at linktime Patch110: chromium-90.0.4430.93-epel8-aarch64-libpng16-symbol-prefixes.patch -# The implementation of linux/userfaultfd.h in EL-8 is too old to support what Chromium wants to do. Turn off the relevant chromium code. -Patch111: chromium-92.0.4515.159-epel8-uffd-off.patch # VAAPI @@ -1054,7 +1052,6 @@ udev. %if 0%{?rhel} == 8 # %%patch107 -p1 -b .el8-arm-incompatible-ints %patch110 -p1 -b .el8-aarch64-libpng16-symbol-prefixes -%patch111 -p1 -b .el8-uffd-off %endif # Feature specific patches diff --git a/sources b/sources index 8bf3438..18a7a4c 100644 --- a/sources +++ b/sources @@ -20,5 +20,4 @@ SHA512 (xcb-proto-1.14.tar.xz) = de66d568163b6da2be9d6c59984f3afa3acd119a7813786 SHA512 (depot_tools.git-master.tar.gz) = dc323888812b66cc92c53a24a8a58ccf9e2961be67aa21852bd091b8b49569071f06ae9104cb58950e6253ac3a29f0db0663e9f35ef2b1ea28696efb38b42708 SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1dc09f5a0fd7898e9d0a372ee4422b6b1cdab3c86ecc91db437e9ae8a951e64e85edc3ac9e9fca428852dbb2ad SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a -SHA512 (chromium-92.0.4515.159-clean.tar.xz) = e5062c35c55232f672008d7c4a06daa69a92e0ed4104ea78e60280e2d7d20bcbf1b52c33229fd3b81983b02cbc949d188e5385b6250662248e11660d1fced31d SHA512 (chromium-93.0.4577.63-clean.tar.xz) = a8d6ad79a52e2df7a12c5922df41855a70f6dddcb76ec5e25177d9b0d565634074de1d86fbc1f894be259f37736d44ee231567596d7a37de96de11a010f2c5d9 From c30e548fd5d1ee871b8f46a07a5aa216cc44c31e Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Sat, 4 Sep 2021 21:06:05 -0400 Subject: [PATCH 032/659] try python3 deps in epel8 --- chromium.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chromium.spec b/chromium.spec index 00646b5..6a9a5ce 100644 --- a/chromium.spec +++ b/chromium.spec @@ -582,7 +582,7 @@ BuildRequires: python3-devel %if 0%{?bundlepylibs} # Using bundled bits, do nothing. %else -%if 0%{?fedora} +%if 0%{?fedora} || %{?rhel} >= 8 BuildRequires: python3-beautifulsoup4 # BuildRequires: python2-beautifulsoup BuildRequires: python3-html5lib From 8ba922708af9958bd2daac03a3cedc80ac40764f Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Sat, 4 Sep 2021 21:37:36 -0400 Subject: [PATCH 033/659] put bundled six in the python path for epel8, system six is too old --- chromium.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chromium.spec b/chromium.spec index 6a9a5ce..712b588 100644 --- a/chromium.spec +++ b/chromium.spec @@ -1648,7 +1648,11 @@ tar xf %{SOURCE20} %endif # export PYTHONPATH="../../third_party/pyjson5/src:../../third_party/catapult/third_party/google-endpoints:../../xcb-proto-1.14" +%if 0%{?rhel} == 8 +export PYTHONPATH="../../third_party/protobuf/third_party/six:../../third_party/pyjson5/src:../../xcb-proto-1.14:../../third_party/catapult/third_party/html5lib-1.1" +%else export PYTHONPATH="../../third_party/pyjson5/src:../../xcb-proto-1.14:../../third_party/catapult/third_party/html5lib-1.1" +%endif echo # Now do the full browser From 367d6daf856d97dc284aa923508d384ce9c40b61 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Sat, 4 Sep 2021 22:22:06 -0400 Subject: [PATCH 034/659] okay, lets try the old node hack on rhel 8 too --- .gitignore | 2 ++ chromium.spec | 19 ++++++++++++++----- sources | 3 ++- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 2e5133d..fb9b0a1 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,5 @@ /xcb-proto-1.14.tar.xz /NotoSansSymbols2-Regular.ttf /NotoSansTibetan-Regular.ttf +/node-v12.22.6-linux-arm64.tar.xz +/node-v12.22.6-linux-x64.tar.xz diff --git a/chromium.spec b/chromium.spec index 712b588..976de9c 100644 --- a/chromium.spec +++ b/chromium.spec @@ -425,7 +425,8 @@ Source17: GardinerModBug.ttf Source18: GardinerModCat.ttf # RHEL 7 needs newer nodejs %if 0%{?rhel} == 7 -Source19: https://nodejs.org/dist/v10.15.3/node-v10.15.3-linux-x64.tar.gz +Source19: https://nodejs.org/dist/latest-v12.x/node-v12.22.6-linux-x64.tar.xz +Source21: https://nodejs.org/dist/latest-v12.x/node-v12.22.6-linux-arm64.tar.xz %endif # Bring xcb-proto with us (might need more than python on EPEL?) Source20: https://www.x.org/releases/individual/proto/xcb-proto-1.14.tar.xz @@ -479,8 +480,8 @@ BuildRequires: minizip-compat-devel # BuildRequires: minizip-devel %endif %endif -# RHEL 7's nodejs is too old -%if 0%{?rhel} == 7 +# RHEL 7|8's nodejs is too old +%if 0%{?rhel} <= 8 # Use bundled. %else BuildRequires: nodejs @@ -1228,10 +1229,18 @@ CHROMIUM_HEADLESS_GN_DEFINES+=' use_cups=false use_dbus=false use_gio=false use_ CHROMIUM_HEADLESS_GN_DEFINES+=' use_pulseaudio=false use_udev=false use_gtk=false use_glib=false use_x11=false' export CHROMIUM_HEADLESS_GN_DEFINES -%if 0%{?rhel} == 7 +%if 0%{?rhel} <= 8 pushd third_party/node/linux +%ifarch x86_64 tar xf %{SOURCE19} -mv node-v10.15.3-linux-x64 node-linux-x64 +mv node-v12.22.6-linux-x64 node-linux-x64 +%endif +%ifarch aarch64 +tar xf %{SOURCE21} +mv node-v12.22.6-linux-arm64 node-linux-arm64 +# This is weird, but whatever +ln -s node-linux-arm64 node-linux-x64 +%endif popd %else mkdir -p third_party/node/linux/node-linux-x64/bin diff --git a/sources b/sources index 18a7a4c..3aaaa1f 100644 --- a/sources +++ b/sources @@ -15,9 +15,10 @@ SHA512 (Tinos-Bold.ttf) = 54aeca804c06a4d5c57ade596e73df91a6a1c4401c4aadba55d987 SHA512 (Tinos-Italic.ttf) = d4f4f096110ef98a781a2a0e0d319317e5f84e650fe6f4d4f6b0e22a16414278217f37497b904a18540273c0e2d79d4f1faabde3b0eb5446283b318c73bafb38 SHA512 (Tinos-Regular.ttf) = 58085c5dac6d067d60ba2ab3220c4a0cc1efcf279cadfcfb8746a5e5fa1a6f6daa62750dc2051b3b2d8a51b4d2e9bb0f66594caf2253c0870ed9c7286fa45e8f SHA512 (Ahem.ttf) = aeb64b10ab9c87860714cb60b4900254b13dc52c51319256a1a3722c882026ab7c616bf628fbc2fe14e38a6003f3a481af60b52a7ed62071d28ddaf428e4e3fd -SHA512 (node-v10.15.3-linux-x64.tar.gz) = 5eb544ef706562981340a82acc79e2162c6a3e4049b4a95f69ce353ee5b0f929c60b1fc457e8249b3fb0696f82fc28c5f543f5947db19fae4e9d5c21b906bb20 SHA512 (xcb-proto-1.14.tar.xz) = de66d568163b6da2be9d6c59984f3afa3acd119a781378638045fd68018665ef5c9af98f024e9962ba3eb7c7a4d85c27ba70ffafceb2324ccc6940f34de16690 SHA512 (depot_tools.git-master.tar.gz) = dc323888812b66cc92c53a24a8a58ccf9e2961be67aa21852bd091b8b49569071f06ae9104cb58950e6253ac3a29f0db0663e9f35ef2b1ea28696efb38b42708 SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1dc09f5a0fd7898e9d0a372ee4422b6b1cdab3c86ecc91db437e9ae8a951e64e85edc3ac9e9fca428852dbb2ad SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a SHA512 (chromium-93.0.4577.63-clean.tar.xz) = a8d6ad79a52e2df7a12c5922df41855a70f6dddcb76ec5e25177d9b0d565634074de1d86fbc1f894be259f37736d44ee231567596d7a37de96de11a010f2c5d9 +SHA512 (node-v12.22.6-linux-arm64.tar.xz) = 87ce5eb954deb1d0debe6fa02b28a3cc675e12fca1e51d44b123ab294aa39ce0c6b8ac9eae1e7a6e32673ea2c2d480651d9ba7eea73012f0529503eebe9eb34d +SHA512 (node-v12.22.6-linux-x64.tar.xz) = e1b55c32343cb2ccc40d888c705414bebf9c46b02083d13731df79b1e79521b7277761f6bcca041e40e3a2e47c67bb8e7848aa2b919a9de5c2ebf62c4a9c7176 From 2cda90bdb4d4d9696cd48f86677c092c51c679a4 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Sat, 4 Sep 2021 22:35:46 -0400 Subject: [PATCH 035/659] fix node conditional to be broader --- chromium.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chromium.spec b/chromium.spec index 976de9c..ccdcd2c 100644 --- a/chromium.spec +++ b/chromium.spec @@ -423,8 +423,8 @@ Source15: http://download.savannah.nongnu.org/releases/freebangfont/MuktiNarrow- Source16: https://github.com/web-platform-tests/wpt/raw/master/fonts/Ahem.ttf Source17: GardinerModBug.ttf Source18: GardinerModCat.ttf -# RHEL 7 needs newer nodejs -%if 0%{?rhel} == 7 +# RHEL 7|8 needs newer nodejs +%if 0%{?rhel} <= 8 Source19: https://nodejs.org/dist/latest-v12.x/node-v12.22.6-linux-x64.tar.xz Source21: https://nodejs.org/dist/latest-v12.x/node-v12.22.6-linux-arm64.tar.xz %endif From 816f9c890b1cc914164ba9a03b6b8c3c0a742d81 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Sat, 4 Sep 2021 23:14:53 -0400 Subject: [PATCH 036/659] drop the freetype hack, rhel 8 uses the bundled freetype which does not need it --- chromium.spec | 3 --- 1 file changed, 3 deletions(-) diff --git a/chromium.spec b/chromium.spec index ccdcd2c..1b2314c 100644 --- a/chromium.spec +++ b/chromium.spec @@ -324,8 +324,6 @@ Patch81: chromium-93-BluetoothLowEnergyScanFilter-include.patch Patch82: chromium-93-ClassProperty-include.patch # Fixes for python3 Patch83: chromium-92.0.4515.107-py3-fixes.patch -# Support older freetype than 2.11 (for epel8) -Patch84: chromium-93.0.4577.63-freetype-2.11.patch # Clean up clang-format for python3 # thanks to Jon Nettleton Patch86: chromium-93.0.4577.63-clang-format.patch @@ -1023,7 +1021,6 @@ udev. %patch81 -p1 -b .BluetoothLowEnergyScanFilter-include %patch82 -p1 -b .ClassProperty-include %patch83 -p1 -b .py3fixes -%patch84 -p1 -b .freetype-2.11 %patch86 -p1 -b .clang-format-py3 %patch87 -p1 -b .ContextSet-permissive %patch88 -p1 -b .DevToolsEmbedderMessageDispatcher-include From 337ca304d21c5c2e3271f137de1e5333bc07ea63 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Thu, 16 Sep 2021 11:56:15 -0400 Subject: [PATCH 037/659] update to 93.0.4577.82 --- chromium.spec | 5 ++++- sources | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/chromium.spec b/chromium.spec index 1b2314c..97f1b15 100644 --- a/chromium.spec +++ b/chromium.spec @@ -224,7 +224,7 @@ Name: chromium%{chromium_channel}%{nsuffix} %else Name: chromium%{chromium_channel} %endif -Version: %{majorversion}.0.4577.63 +Version: %{majorversion}.0.4577.82 Release: 1%{?dist} %if %{?freeworld} %if %{?shared} @@ -2115,6 +2115,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Thu Sep 16 2021 Tom Callaway - 93.0.4577.82-1 +- update to 93.0.4577.82 + * Thu Sep 2 2021 Tom Callaway - 93.0.4577.63-1 - update to 93.0.4577.63 diff --git a/sources b/sources index 3aaaa1f..dfc9ddf 100644 --- a/sources +++ b/sources @@ -19,6 +19,6 @@ SHA512 (xcb-proto-1.14.tar.xz) = de66d568163b6da2be9d6c59984f3afa3acd119a7813786 SHA512 (depot_tools.git-master.tar.gz) = dc323888812b66cc92c53a24a8a58ccf9e2961be67aa21852bd091b8b49569071f06ae9104cb58950e6253ac3a29f0db0663e9f35ef2b1ea28696efb38b42708 SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1dc09f5a0fd7898e9d0a372ee4422b6b1cdab3c86ecc91db437e9ae8a951e64e85edc3ac9e9fca428852dbb2ad SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a -SHA512 (chromium-93.0.4577.63-clean.tar.xz) = a8d6ad79a52e2df7a12c5922df41855a70f6dddcb76ec5e25177d9b0d565634074de1d86fbc1f894be259f37736d44ee231567596d7a37de96de11a010f2c5d9 SHA512 (node-v12.22.6-linux-arm64.tar.xz) = 87ce5eb954deb1d0debe6fa02b28a3cc675e12fca1e51d44b123ab294aa39ce0c6b8ac9eae1e7a6e32673ea2c2d480651d9ba7eea73012f0529503eebe9eb34d SHA512 (node-v12.22.6-linux-x64.tar.xz) = e1b55c32343cb2ccc40d888c705414bebf9c46b02083d13731df79b1e79521b7277761f6bcca041e40e3a2e47c67bb8e7848aa2b919a9de5c2ebf62c4a9c7176 +SHA512 (chromium-93.0.4577.82-clean.tar.xz) = a304c47308d8694855b59d016d09cd265b453d466a0fe9c6bb24ef19654f8497b076b2948c085b37e85f1d436f416c5dcf91ba4160544b75262629aa29d07250 From 17a39d0d1fa0a958d0dc575dc58d87268e161f1d Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Thu, 16 Sep 2021 11:57:40 -0400 Subject: [PATCH 038/659] update to 93.0.4577.82 --- chromium.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chromium.spec b/chromium.spec index 97f1b15..475ca1b 100644 --- a/chromium.spec +++ b/chromium.spec @@ -581,7 +581,7 @@ BuildRequires: python3-devel %if 0%{?bundlepylibs} # Using bundled bits, do nothing. %else -%if 0%{?fedora} || %{?rhel} >= 8 +%if 0%{?fedora} || 0%{?rhel} >= 8 BuildRequires: python3-beautifulsoup4 # BuildRequires: python2-beautifulsoup BuildRequires: python3-html5lib From 42f4d2d0e5aaaadb8090634f7c7e4df046a41954 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Thu, 16 Sep 2021 17:53:57 -0400 Subject: [PATCH 039/659] fix conditional so that Fedora does not use the bundled node it does not need --- chromium.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chromium.spec b/chromium.spec index 475ca1b..afdb13a 100644 --- a/chromium.spec +++ b/chromium.spec @@ -1226,7 +1226,7 @@ CHROMIUM_HEADLESS_GN_DEFINES+=' use_cups=false use_dbus=false use_gio=false use_ CHROMIUM_HEADLESS_GN_DEFINES+=' use_pulseaudio=false use_udev=false use_gtk=false use_glib=false use_x11=false' export CHROMIUM_HEADLESS_GN_DEFINES -%if 0%{?rhel} <= 8 +%if 0%{?rhel} && 0%{?rhel} <= 8 pushd third_party/node/linux %ifarch x86_64 tar xf %{SOURCE19} From 9292805640ae7e7dbb6742f26c55dfcf355a67fa Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Fri, 17 Sep 2021 10:40:24 -0400 Subject: [PATCH 040/659] fix the rest of the node conditionals --- chromium.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chromium.spec b/chromium.spec index afdb13a..4c3d565 100644 --- a/chromium.spec +++ b/chromium.spec @@ -422,7 +422,7 @@ Source16: https://github.com/web-platform-tests/wpt/raw/master/fonts/Ahem.ttf Source17: GardinerModBug.ttf Source18: GardinerModCat.ttf # RHEL 7|8 needs newer nodejs -%if 0%{?rhel} <= 8 +%if 0%{?rhel} && 0%{?rhel} <= 8 Source19: https://nodejs.org/dist/latest-v12.x/node-v12.22.6-linux-x64.tar.xz Source21: https://nodejs.org/dist/latest-v12.x/node-v12.22.6-linux-arm64.tar.xz %endif @@ -479,7 +479,7 @@ BuildRequires: minizip-compat-devel %endif %endif # RHEL 7|8's nodejs is too old -%if 0%{?rhel} <= 8 +%if 0%{?rhel} && 0%{?rhel} <= 8 # Use bundled. %else BuildRequires: nodejs From d2a8ef647b2dff477b0cff43a43812ae7b948b35 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Mon, 20 Sep 2021 13:41:41 -0400 Subject: [PATCH 041/659] fix against harfbuzz v3, thanks to Jan Beich @ FreeBSD --- chromium-93.0.4577.82-harfbuzz3.patch | 97 +++++++++++++++++++++++++++ chromium.spec | 11 ++- 2 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 chromium-93.0.4577.82-harfbuzz3.patch diff --git a/chromium-93.0.4577.82-harfbuzz3.patch b/chromium-93.0.4577.82-harfbuzz3.patch new file mode 100644 index 0000000..1ed23fe --- /dev/null +++ b/chromium-93.0.4577.82-harfbuzz3.patch @@ -0,0 +1,97 @@ +diff -up chromium-93.0.4577.82/components/paint_preview/common/subset_font.cc.hbfix chromium-93.0.4577.82/components/paint_preview/common/subset_font.cc +--- chromium-93.0.4577.82/components/paint_preview/common/subset_font.cc.hbfix 2021-09-20 11:37:58.633517817 -0400 ++++ chromium-93.0.4577.82/components/paint_preview/common/subset_font.cc 2021-09-20 11:40:12.111235467 -0400 +@@ -72,9 +72,11 @@ sk_sp SubsetFont(SkTypeface* typ + hb_set_t* glyphs = + hb_subset_input_glyph_set(input.get()); // Owned by |input|. + usage.ForEach(base::BindRepeating(&AddGlyphs, base::Unretained(glyphs))); +- hb_subset_input_set_retain_gids(input.get(), true); ++ hb_subset_input_set_flags(input.get(), HB_SUBSET_FLAGS_RETAIN_GIDS); + +- HbScoped subset_face(hb_subset(face.get(), input.get())); ++ HbScoped subset_face(hb_subset_or_fail(face.get(), input.get())); ++ if (!subset_face) ++ return nullptr; + HbScoped subset_blob(hb_face_reference_blob(subset_face.get())); + if (!subset_blob) + return nullptr; +diff -up chromium-93.0.4577.82/third_party/skia/gn/skia.gni.hbfix chromium-93.0.4577.82/third_party/skia/gn/skia.gni +--- chromium-93.0.4577.82/third_party/skia/gn/skia.gni.hbfix 2021-09-20 11:41:20.078600944 -0400 ++++ chromium-93.0.4577.82/third_party/skia/gn/skia.gni 2021-09-20 11:42:29.851976086 -0400 +@@ -33,8 +33,6 @@ declare_args() { + skia_include_multiframe_procs = false + skia_lex = false + skia_libgifcodec_path = "third_party/externals/libgifcodec" +- skia_pdf_subset_harfbuzz = +- false # TODO: set skia_pdf_subset_harfbuzz to skia_use_harfbuzz. + skia_qt_path = getenv("QT_PATH") + skia_skqp_global_error_tolerance = 0 + skia_tools_require_resources = false +@@ -99,6 +97,10 @@ declare_args() { + } + + declare_args() { ++ skia_pdf_subset_harfbuzz = skia_use_harfbuzz ++} ++ ++declare_args() { + skia_compile_sksl_tests = skia_compile_processors + skia_enable_fontmgr_android = skia_use_expat && skia_use_freetype + skia_enable_fontmgr_custom_directory = skia_use_freetype && !is_fuchsia +diff -up chromium-93.0.4577.82/third_party/skia/src/pdf/SkPDFSubsetFont.cpp.hbfix chromium-93.0.4577.82/third_party/skia/src/pdf/SkPDFSubsetFont.cpp +--- chromium-93.0.4577.82/third_party/skia/src/pdf/SkPDFSubsetFont.cpp.hbfix 2021-09-20 13:34:57.861369449 -0400 ++++ chromium-93.0.4577.82/third_party/skia/src/pdf/SkPDFSubsetFont.cpp 2021-09-20 13:38:28.063504311 -0400 +@@ -49,6 +49,37 @@ static sk_sp to_data(HBBlob blob + blob.release()); + } + ++template using void_t = void; ++template ++struct SkPDFHarfBuzzSubset { ++ // This is the HarfBuzz 3.0 interface. ++ // hb_subset_flags_t does not exist in 2.0. It isn't dependent on T, so inline the value of ++ // HB_SUBSET_FLAGS_RETAIN_GIDS until 2.0 is no longer supported. ++ static HBFace Make(T input, hb_face_t* face) { ++ // TODO: When possible, check if a font is 'tricky' with FT_IS_TRICKY. ++ // If it isn't known if a font is 'tricky', retain the hints. ++ hb_subset_input_set_flags(input, 2/*HB_SUBSET_FLAGS_RETAIN_GIDS*/); ++ return HBFace(hb_subset_or_fail(face, input)); ++ } ++}; ++template ++struct SkPDFHarfBuzzSubset(), std::declval())), ++ decltype(hb_subset_input_set_drop_hints(std::declval(), std::declval())), ++ decltype(hb_subset(std::declval(), std::declval())) ++ >> ++{ ++ // This is the HarfBuzz 2.0 (non-public) interface, used if it exists. ++ // This code should be removed as soon as all users are migrated to the newer API. ++ static HBFace Make(T input, hb_face_t* face) { ++ hb_subset_input_set_retain_gids(input, true); ++ // TODO: When possible, check if a font is 'tricky' with FT_IS_TRICKY. ++ // If it isn't known if a font is 'tricky', retain the hints. ++ hb_subset_input_set_drop_hints(input, false); ++ return HBFace(hb_subset(face, input)); ++ } ++}; ++ + static sk_sp subset_harfbuzz(sk_sp fontData, + const SkPDFGlyphUse& glyphUsage, + int ttcIndex) { +@@ -71,11 +102,10 @@ static sk_sp subset_harfbuzz(sk_ + hb_set_t* glyphs = hb_subset_input_glyph_set(input.get()); + glyphUsage.getSetValues([&glyphs](unsigned gid) { hb_set_add(glyphs, gid);}); + +- hb_subset_input_set_retain_gids(input.get(), true); +- // TODO: When possible, check if a font is 'tricky' with FT_IS_TRICKY. +- // If it isn't known if a font is 'tricky', retain the hints. +- hb_subset_input_set_drop_hints(input.get(), false); +- HBFace subset(hb_subset(face.get(), input.get())); ++ HBFace subset = SkPDFHarfBuzzSubset::Make(input.get(), face.get()); ++ if (!subset) { ++ return nullptr; ++ } + HBBlob result(hb_face_reference_blob(subset.get())); + return to_data(std::move(result)); + } diff --git a/chromium.spec b/chromium.spec index 4c3d565..43dceef 100644 --- a/chromium.spec +++ b/chromium.spec @@ -225,7 +225,7 @@ Name: chromium%{chromium_channel}%{nsuffix} Name: chromium%{chromium_channel} %endif Version: %{majorversion}.0.4577.82 -Release: 1%{?dist} +Release: 2%{?dist} %if %{?freeworld} %if %{?shared} # chromium-libs-media-freeworld @@ -349,6 +349,9 @@ Patch93: chromium-93.0.4577.63-vector-fix.patch Patch94: chromium-93.0.4577.63-remoting-nodestructor-fix.patch # include full UrlResponseHead header Patch95: chromium-93.0.4577.63-mojo-header-fix.patch +# Fix against HarfBuzz v3 +# Thanks to Jan Beich @ FreeBSD +Patch96: chromium-93.0.4577.82-harfbuzz3.patch # Use lstdc++ on EPEL7 only @@ -1031,6 +1034,9 @@ udev. %patch93 -p1 -b .vector-fix %patch94 -p1 -b .remoting-nodestructor-fix %patch95 -p1 -b .mojo-header-fix +%if 0%{?fedora} >= 36 +%patch96 -p1 -b .hbfix +%endif # Fedora branded user agent %if 0%{?fedora} @@ -2115,6 +2121,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Mon Sep 20 2021 Tom Callaway - 93.0.4577.82-2 +- add fix for harfbuzz v3 (thanks to Jan Beich @ FreeBSD) + * Thu Sep 16 2021 Tom Callaway - 93.0.4577.82-1 - update to 93.0.4577.82 From 44f3dccc395e238914bdbb1cb4235bc8118f85db Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Mon, 27 Sep 2021 11:21:51 -0400 Subject: [PATCH 042/659] 94.0.4606.61 --- chromium-94-ConversionStorageSql-lambda.patch | 31 ++++++++ chromium-94-CustomSpaces-include.patch | 24 ++++++ ...m-94.0.4606.54-gcc9-drop-rsp-clobber.patch | 12 +++ ....0.4606.54-remoting-nodestructor-fix.patch | 22 ++++++ ...webrtc-BUILD.gn-fix-multiple-defines.patch | 16 ++++ ...4606.61-remoting-extra-qualification.patch | 12 +++ chromium.spec | 79 ++++++++----------- clean_ffmpeg.sh | 1 + sources | 2 +- 9 files changed, 150 insertions(+), 49 deletions(-) create mode 100644 chromium-94-ConversionStorageSql-lambda.patch create mode 100644 chromium-94-CustomSpaces-include.patch create mode 100644 chromium-94.0.4606.54-gcc9-drop-rsp-clobber.patch create mode 100644 chromium-94.0.4606.54-remoting-nodestructor-fix.patch create mode 100644 chromium-94.0.4606.54-webrtc-BUILD.gn-fix-multiple-defines.patch create mode 100644 chromium-94.0.4606.61-remoting-extra-qualification.patch diff --git a/chromium-94-ConversionStorageSql-lambda.patch b/chromium-94-ConversionStorageSql-lambda.patch new file mode 100644 index 0000000..6746fec --- /dev/null +++ b/chromium-94-ConversionStorageSql-lambda.patch @@ -0,0 +1,31 @@ +From 45bea088d3771c7ff9f77173e451422452c031b3 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Mon, 02 Aug 2021 16:57:05 +0000 +Subject: [PATCH] GCC: drop WARN_USED_RESULT in lambda in ConversionStorageSql + +GCC 9.3 only allows GNU attributes between [] and () in lambda +expressions. See https://gcc.gnu.org/PR90333 for details. However, +clang only allows attributes after () only. Seems not strictly +necessary to enforce the attribute here. + +Bug: 819294 +Change-Id: I342deb25239837dea0f6f5e7709b1467789e342b +--- + +diff --git a/content/browser/conversions/conversion_storage_sql.cc b/content/browser/conversions/conversion_storage_sql.cc +index 84bc897..b6fc4e9 100644 +--- a/content/browser/conversions/conversion_storage_sql.cc ++++ b/content/browser/conversions/conversion_storage_sql.cc +@@ -688,9 +688,11 @@ + bool ConversionStorageSql::DeleteExpiredImpressions() { + const int kMaxDeletesPerBatch = 100; + ++ // GCC accepts attribute between [] and () only ++ // clang accepts attribute after () only + auto delete_impressions_from_paged_select = + [this](sql::Statement& statement) +- VALID_CONTEXT_REQUIRED(sequence_checker_) WARN_UNUSED_RESULT -> bool { ++ VALID_CONTEXT_REQUIRED(sequence_checker_) -> bool { + while (true) { + std::vector impression_ids; + while (statement.Step()) { diff --git a/chromium-94-CustomSpaces-include.patch b/chromium-94-CustomSpaces-include.patch new file mode 100644 index 0000000..0175775 --- /dev/null +++ b/chromium-94-CustomSpaces-include.patch @@ -0,0 +1,24 @@ +From 4eeacdaa57b29a079fe09315eb22557c06aa522e Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Fri, 13 Aug 2021 12:57:42 +0000 +Subject: [PATCH] IWYU: add memory for std::unique_ptr in blink::CustomSpaces + +--- + .../blink/renderer/platform/heap/v8_wrapper/custom_spaces.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/third_party/blink/renderer/platform/heap/v8_wrapper/custom_spaces.h b/third_party/blink/renderer/platform/heap/v8_wrapper/custom_spaces.h +index df0465a..640cb33 100644 +--- a/third_party/blink/renderer/platform/heap/v8_wrapper/custom_spaces.h ++++ b/third_party/blink/renderer/platform/heap/v8_wrapper/custom_spaces.h +@@ -5,6 +5,7 @@ + #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_V8_WRAPPER_CUSTOM_SPACES_H_ + #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_V8_WRAPPER_CUSTOM_SPACES_H_ + ++#include + #include + + #include "third_party/blink/renderer/platform/platform_export.h" +-- +2.31.1 + diff --git a/chromium-94.0.4606.54-gcc9-drop-rsp-clobber.patch b/chromium-94.0.4606.54-gcc9-drop-rsp-clobber.patch new file mode 100644 index 0000000..0ccd0b1 --- /dev/null +++ b/chromium-94.0.4606.54-gcc9-drop-rsp-clobber.patch @@ -0,0 +1,12 @@ +diff -up chromium-94.0.4606.54/third_party/tcmalloc/vendor/src/base/linux_syscall_support.h.gcc9 chromium-94.0.4606.54/third_party/tcmalloc/vendor/src/base/linux_syscall_support.h +--- chromium-94.0.4606.54/third_party/tcmalloc/vendor/src/base/linux_syscall_support.h.gcc9 2021-09-20 15:13:05.000000000 -0400 ++++ chromium-94.0.4606.54/third_party/tcmalloc/vendor/src/base/linux_syscall_support.h 2021-09-23 12:41:53.540357702 -0400 +@@ -1485,7 +1485,7 @@ struct kernel_stat { + "d"(LSS_SYSCALL_ARG(parent_tidptr)), + "r"(LSS_SYSCALL_ARG(newtls)), + "r"(LSS_SYSCALL_ARG(child_tidptr)) +- : "rsp", "memory", "r8", "r10", "r11", "rcx"); ++ : "memory", "r8", "r10", "r11", "rcx"); + } + LSS_RETURN(int, __res); + } diff --git a/chromium-94.0.4606.54-remoting-nodestructor-fix.patch b/chromium-94.0.4606.54-remoting-nodestructor-fix.patch new file mode 100644 index 0000000..ce64c55 --- /dev/null +++ b/chromium-94.0.4606.54-remoting-nodestructor-fix.patch @@ -0,0 +1,22 @@ +diff -up chromium-94.0.4606.54/remoting/host/remote_open_url_client.cc.remoting-nodestructor-fix chromium-94.0.4606.54/remoting/host/remote_open_url_client.cc +diff -up chromium-94.0.4606.54/remoting/host/remote_open_url_client_delegate_linux.cc.remoting-nodestructor-fix chromium-94.0.4606.54/remoting/host/remote_open_url_client_delegate_linux.cc +--- chromium-94.0.4606.54/remoting/host/remote_open_url_client_delegate_linux.cc.remoting-nodestructor-fix 2021-09-24 11:02:02.662082902 -0400 ++++ chromium-94.0.4606.54/remoting/host/remote_open_url_client_delegate_linux.cc 2021-09-24 11:06:05.207472179 -0400 +@@ -47,7 +47,7 @@ void ShowMessageDialog(const std::string + } + + bool IsBrowserValid(const std::string& browser) { +- static const base::NoDestructor> invalid_browsers( ++ static const base::NoDestructor> invalid_browsers{ + { + // This is the chromoting forwarder itself. + "crd-url-forwarder.desktop", +@@ -55,7 +55,7 @@ bool IsBrowserValid(const std::string& b + // XFCE's forwarder. May potentially launch the chromoting forwarder + // recursively. + "xfce4-web-browser.desktop", +- }); ++ }}; + if (browser.empty()) { + return false; + } diff --git a/chromium-94.0.4606.54-webrtc-BUILD.gn-fix-multiple-defines.patch b/chromium-94.0.4606.54-webrtc-BUILD.gn-fix-multiple-defines.patch new file mode 100644 index 0000000..04ed84e --- /dev/null +++ b/chromium-94.0.4606.54-webrtc-BUILD.gn-fix-multiple-defines.patch @@ -0,0 +1,16 @@ +diff -up chromium-94.0.4606.54/third_party/webrtc/BUILD.gn.fix-multiple-define chromium-94.0.4606.54/third_party/webrtc/BUILD.gn +--- chromium-94.0.4606.54/third_party/webrtc/BUILD.gn.fix-multiple-define 2021-09-24 13:22:48.067565858 -0400 ++++ chromium-94.0.4606.54/third_party/webrtc/BUILD.gn 2021-09-24 13:23:10.163664830 -0400 +@@ -119,10 +119,10 @@ config("common_inherited_config") { + ldflags = [] + + if (rtc_enable_symbol_export || is_component_build) { +- defines = [ "WEBRTC_ENABLE_SYMBOL_EXPORT" ] ++ defines += [ "WEBRTC_ENABLE_SYMBOL_EXPORT" ] + } + if (rtc_enable_objc_symbol_export) { +- defines = [ "WEBRTC_ENABLE_OBJC_SYMBOL_EXPORT" ] ++ defines += [ "WEBRTC_ENABLE_OBJC_SYMBOL_EXPORT" ] + } + + if (build_with_mozilla) { diff --git a/chromium-94.0.4606.61-remoting-extra-qualification.patch b/chromium-94.0.4606.61-remoting-extra-qualification.patch new file mode 100644 index 0000000..2b64739 --- /dev/null +++ b/chromium-94.0.4606.61-remoting-extra-qualification.patch @@ -0,0 +1,12 @@ +diff -up chromium-94.0.4606.61/remoting/host/mojom/remoting_mojom_traits.h.extra-qualification chromium-94.0.4606.61/remoting/host/mojom/remoting_mojom_traits.h +--- chromium-94.0.4606.61/remoting/host/mojom/remoting_mojom_traits.h.extra-qualification 2021-09-25 01:48:28.812426004 +0000 ++++ chromium-94.0.4606.61/remoting/host/mojom/remoting_mojom_traits.h 2021-09-25 01:48:59.072267580 +0000 +@@ -17,7 +17,7 @@ + namespace mojo { + + template <> +-class mojo::StructTraits { + public: + static const std::string& mime_type( diff --git a/chromium.spec b/chromium.spec index 43dceef..ac593e9 100644 --- a/chromium.spec +++ b/chromium.spec @@ -171,7 +171,8 @@ BuildRequires: libicu-devel >= 5.4 %global bundlelibwebp 0 %global bundlelibpng 0 %global bundlelibjpeg 0 -%global bundlefreetype 0 +# Needs FT_ClipBox which was implemented after 2.11.0. Should be able to set this back to 0 later. +%global bundlefreetype 1 %global bundlelibdrm 0 %global bundlefontconfig 0 %endif @@ -217,15 +218,15 @@ BuildRequires: libicu-devel >= 5.4 %global chromoting_client_id %nil %endif -%global majorversion 93 +%global majorversion 94 %if %{freeworld} Name: chromium%{chromium_channel}%{nsuffix} %else Name: chromium%{chromium_channel} %endif -Version: %{majorversion}.0.4577.82 -Release: 2%{?dist} +Version: %{majorversion}.0.4606.61 +Release: 1%{?dist} %if %{?freeworld} %if %{?shared} # chromium-libs-media-freeworld @@ -260,7 +261,7 @@ Patch7: chromium-71.0.3578.98-widevine-r3.patch # Disable fontconfig cache magic that breaks remoting Patch8: chromium-91.0.4472.77-disable-fontconfig-cache-magic.patch # drop rsp clobber, which breaks gcc9 (thanks to Jeff Law) -Patch9: chromium-78.0.3904.70-gcc9-drop-rsp-clobber.patch +Patch9: chromium-94.0.4606.54-gcc9-drop-rsp-clobber.patch # Try to load widevine from other places Patch10: chromium-92.0.4515.107-widevine-other-locations.patch # Tell bootstrap.py to always use the version of Python we specify @@ -289,9 +290,6 @@ Patch57: chromium-93.0.4577.63-missing-cstring.patch Patch58: chromium-53-ffmpeg-no-deprecation-errors.patch # https://github.com/stha09/chromium-patches/blob/master/chromium-91-libyuv-aarch64.patch Patch60: chromium-91-libyuv-aarch64.patch -# Update third_party/highway to 0.12.2 -# this is needed for sane arm/aarch64 -Patch61: chromium-92.0.4515.107-update-highway-0.12.2.patch # https://github.com/stha09/chromium-patches/blob/master/chromium-90-ruy-include.patch Patch62: chromium-90-ruy-include.patch # Extra CXXFLAGS for aarch64 @@ -308,9 +306,6 @@ Patch66: chromium-84.0.4147.125-remoting-cstring.patch Patch67: chromium-84.0.4147.125-i686-fix_textrels.patch # Work around binutils bug in aarch64 (F33+) Patch68: chromium-84.0.4147.125-aarch64-clearkeycdm-binutils-workaround.patch -# Fix sandbox code to properly handle the new way that glibc handles fstat in Fedora 34+ -# Thanks to Kevin Kofler for the fix. -Patch75: chromium-90.0.4430.72-fstatfix.patch # Rawhide (f35) glibc defines SIGSTKSZ as a long instead of a constant Patch76: chromium-92.0.4515.107-rawhide-gcc-std-max-fix.patch # Do not download proprietary widevine module in the background (thanks Debian) @@ -318,27 +313,16 @@ Patch79: chromium-93.0.4577.63-widevine-no-download.patch # Fix crashes with components/cast_* # Thanks to Gentoo Patch80: chromium-92.0.4515.107-EnumTable-crash.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-93-BluetoothLowEnergyScanFilter-include.patch -Patch81: chromium-93-BluetoothLowEnergyScanFilter-include.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-93-ClassProperty-include.patch -Patch82: chromium-93-ClassProperty-include.patch + +# https://github.com/stha09/chromium-patches/blob/master/chromium-94-ConversionStorageSql-lambda.patch +Patch81: chromium-94-ConversionStorageSql-lambda.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-94-CustomSpaces-include.patch +Patch82: chromium-94-CustomSpaces-include.patch # Fixes for python3 Patch83: chromium-92.0.4515.107-py3-fixes.patch # Clean up clang-format for python3 # thanks to Jon Nettleton Patch86: chromium-93.0.4577.63-clang-format.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-93-ContextSet-permissive.patch -Patch87: chromium-93-ContextSet-permissive.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-93-DevToolsEmbedderMessageDispatcher-include.patch -Patch88: chromium-93-DevToolsEmbedderMessageDispatcher-include.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-93-FormForest-constexpr.patch -Patch89: chromium-93-FormForest-constexpr.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-93-HashPasswordManager-include.patch -Patch90: chromium-93-HashPasswordManager-include.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-93-pdfium-include.patch -Patch91: chromium-93-pdfium-include.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-93-ScopedTestDialogAutoConfirm-include.patch -Patch92: chromium-93-ScopedTestDialogAutoConfirm-include.patch # In file included from ../../components/cast_channel/enum_table.cc:5: # ../../components/cast_channel/enum_table.h:359:18: error: 'vector' in namespace 'std' does not name a template type # 359 | const std::vector data_; @@ -346,12 +330,13 @@ Patch92: chromium-93-ScopedTestDialogAutoConfirm-include.patch # ../../components/cast_channel/enum_table.h:18:1: note: 'std::vector' is defined in header ''; did you forget to '#include '? Patch93: chromium-93.0.4577.63-vector-fix.patch # Fix NoDestructor issue with gcc -Patch94: chromium-93.0.4577.63-remoting-nodestructor-fix.patch +Patch94: chromium-94.0.4606.54-remoting-nodestructor-fix.patch # include full UrlResponseHead header Patch95: chromium-93.0.4577.63-mojo-header-fix.patch -# Fix against HarfBuzz v3 -# Thanks to Jan Beich @ FreeBSD -Patch96: chromium-93.0.4577.82-harfbuzz3.patch +# Fix multiple defines issue in webrtc/BUILD.gn +Patch96: chromium-94.0.4606.54-webrtc-BUILD.gn-fix-multiple-defines.patch +# Fix extra qualification error +Patch97: chromium-94.0.4606.61-remoting-extra-qualification.patch # Use lstdc++ on EPEL7 only @@ -770,7 +755,7 @@ Provides: bundled(fips181) = 2.2.3 Provides: bundled(fontconfig) = 2.12.6 %endif %if 0%{?bundlefreetype} -Provides: bundled(freetype) = 2.9.3 +Provides: bundled(freetype) = 2.11.0git %endif Provides: bundled(gperftools) = svn144 %if 0%{?bundleharfbuzz} @@ -1007,7 +992,6 @@ udev. %patch57 -p1 -b .missing-cstring %patch58 -p1 -b .ffmpeg-deprecations %patch60 -p1 -b .libyuv-aarch64 -%patch61 -p1 -b .update-highway-0.12.2 %patch62 -p1 -b .ruy-include %patch63 -p1 -b .aarch64-cxxflags-addition %patch64 -p1 -b .java-only-allowed @@ -1015,28 +999,20 @@ udev. %patch66 -p1 -b .remoting-cstring %patch67 -p1 -b .i686-textrels %patch68 -p1 -b .aarch64-clearkeycdm-binutils-workaround -%patch75 -p1 -b .fstatfix %if 0%{?fedora} >= 35 %patch76 -p1 -b .sigstkszfix %endif %patch79 -p1 -b .widevine-no-download %patch80 -p1 -b .EnumTable-crash -%patch81 -p1 -b .BluetoothLowEnergyScanFilter-include -%patch82 -p1 -b .ClassProperty-include +%patch81 -p1 -b .ConversionStorageSql-lambda-include +%patch82 -p1 -b .CustomSpaces-include %patch83 -p1 -b .py3fixes %patch86 -p1 -b .clang-format-py3 -%patch87 -p1 -b .ContextSet-permissive -%patch88 -p1 -b .DevToolsEmbedderMessageDispatcher-include -%patch89 -p1 -b .FormForest-constexpr -%patch90 -p1 -b .HashPasswordManager-include -%patch91 -p1 -b .pdfium-include -%patch92 -p1 -b .ScopedTestDialogAutoConfirm-include %patch93 -p1 -b .vector-fix %patch94 -p1 -b .remoting-nodestructor-fix %patch95 -p1 -b .mojo-header-fix -%if 0%{?fedora} >= 36 -%patch96 -p1 -b .hbfix -%endif +%patch96 -p1 -b .webrtc-BUILD.gn-fix-multiple-defines +%patch97 -p1 -b .remoting-extra-qualification # Fedora branded user agent %if 0%{?fedora} @@ -1175,7 +1151,7 @@ CHROMIUM_CORE_GN_DEFINES+=' google_api_key="%{api_key}"' %if %{userestrictedapikeys} CHROMIUM_CORE_GN_DEFINES+=' google_default_client_id="%{default_client_id}" google_default_client_secret="%{default_client_secret}"' %endif -CHROMIUM_CORE_GN_DEFINES+=' is_clang=false use_sysroot=false fieldtrial_testing_like_official_build=true use_lld=false rtc_enable_symbol_export=true' +CHROMIUM_CORE_GN_DEFINES+=' is_clang=false use_sysroot=false disable_fieldtrial_testing_config=true use_lld=false rtc_enable_symbol_export=true' %if %{use_gold} CHROMIUM_CORE_GN_DEFINES+=' use_gold=true' %else @@ -1335,6 +1311,7 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/devtools-frontend/src/front_end/third_party/marked' \ 'third_party/devtools-frontend/src/front_end/third_party/puppeteer' \ 'third_party/devtools-frontend/src/front_end/third_party/wasmparser' \ + 'third_party/devtools-frontend/src/test/unittests/front_end/third_party/i18n' \ 'third_party/dom_distiller_js' \ 'third_party/eigen3' \ 'third_party/emoji-segmenter' \ @@ -1733,7 +1710,7 @@ rm -rf %{buildroot} %endif cp -a chrome %{buildroot}%{chromium_path}/%{chromium_browser_channel} cp -a chrome_sandbox %{buildroot}%{chromium_path}/chrome-sandbox - cp -a crashpad_handler %{buildroot}%{chromium_path}/crashpad_handler + cp -a chrome_crashpad_handler %{buildroot}%{chromium_path}/chrome_crashpad_handler cp -a ../../chrome/app/resources/manpage.1.in %{buildroot}%{_mandir}/man1/%{chromium_browser_channel}.1 sed -i "s|@@PACKAGE@@|%{chromium_browser_channel}|g" %{buildroot}%{_mandir}/man1/%{chromium_browser_channel}.1 sed -i "s|@@MENUNAME@@|%{chromium_menu_name}|g" %{buildroot}%{_mandir}/man1/%{chromium_browser_channel}.1 @@ -1965,7 +1942,7 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %dir %{chromium_path} %{chromium_path}/*.bin %{chromium_path}/chrome_*.pak -%{chromium_path}/crashpad_handler +%{chromium_path}/chrome_crashpad_handler %{chromium_path}/resources.pak %{chromium_path}/icudtl.dat %{chromium_path}/%{chromium_browser_channel} @@ -2121,6 +2098,12 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Fri Sep 24 2021 Tom Callaway - 94.0.4606.61-1 +- update to 94.0.4606.61 + +* Thu Sep 23 2021 Tom Callaway - 94.0.4606.54-1 +- update to 94.0.4606.54 + * Mon Sep 20 2021 Tom Callaway - 93.0.4577.82-2 - add fix for harfbuzz v3 (thanks to Jan Beich @ FreeBSD) diff --git a/clean_ffmpeg.sh b/clean_ffmpeg.sh index 518eb5e..002dae9 100755 --- a/clean_ffmpeg.sh +++ b/clean_ffmpeg.sh @@ -79,6 +79,7 @@ header_files=" libavcodec/x86/inline_asm.h \ libavcodec/codec_par.h \ libavcodec/dct.h \ libavcodec/dct32.h \ + libavcodec/defs.h \ libavcodec/error_resilience.h \ libavcodec/fdctdsp.h \ libavcodec/fft.h \ diff --git a/sources b/sources index dfc9ddf..e1d64f9 100644 --- a/sources +++ b/sources @@ -21,4 +21,4 @@ SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1d SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a SHA512 (node-v12.22.6-linux-arm64.tar.xz) = 87ce5eb954deb1d0debe6fa02b28a3cc675e12fca1e51d44b123ab294aa39ce0c6b8ac9eae1e7a6e32673ea2c2d480651d9ba7eea73012f0529503eebe9eb34d SHA512 (node-v12.22.6-linux-x64.tar.xz) = e1b55c32343cb2ccc40d888c705414bebf9c46b02083d13731df79b1e79521b7277761f6bcca041e40e3a2e47c67bb8e7848aa2b919a9de5c2ebf62c4a9c7176 -SHA512 (chromium-93.0.4577.82-clean.tar.xz) = a304c47308d8694855b59d016d09cd265b453d466a0fe9c6bb24ef19654f8497b076b2948c085b37e85f1d436f416c5dcf91ba4160544b75262629aa29d07250 +SHA512 (chromium-94.0.4606.61-clean.tar.xz) = 376d619e4bc4d5a5641aaf22d855889465c9b8990dcbc83517548edc9ada2e7087b66e839090c82cbbe2d46c2e98dc7f4b6461390a1f0d1d298cc698d1736b5e From 6c879ca204bdcf4482b58c901e2589c9b74db009 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Tue, 28 Sep 2021 09:48:42 -0400 Subject: [PATCH 043/659] use bundled harfbuzz on Fedora < 36 --- chromium.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/chromium.spec b/chromium.spec index ac593e9..63387ae 100644 --- a/chromium.spec +++ b/chromium.spec @@ -165,7 +165,12 @@ BuildRequires: libicu-devel >= 5.4 %global bundlelibdrm 1 %global bundlefontconfig 1 %else +# As of Chromium 94, it uses functions in harfbuzz 2.9.0+, which is only found in F36+. +%if 0%{?fedora} >= 36 %global bundleharfbuzz 0 +%else +%global bundleharfbuzz 1 +%endif %global bundleopus 1 %global bundlelibusbx 0 %global bundlelibwebp 0 From dd11e54bff0c8084ba9dd11cf85d600f5002fb18 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Tue, 28 Sep 2021 11:50:39 -0400 Subject: [PATCH 044/659] remove old harfbuzz conditional logic --- chromium.spec | 8 -------- 1 file changed, 8 deletions(-) diff --git a/chromium.spec b/chromium.spec index 63387ae..42404ca 100644 --- a/chromium.spec +++ b/chromium.spec @@ -182,14 +182,6 @@ BuildRequires: libicu-devel >= 5.4 %global bundlefontconfig 0 %endif -# Needs at least harfbuzz 2.4.0 now. -# 2019-09-13 -%if 0%{?fedora} < 31 -%global bundleharfbuzz 1 -%else -%global bundleharfbuzz 0 -%endif - ### From 2013 until early 2021, Google permitted distribution builds of ### Chromium to access Google APIs that added significant features to ### Chromium including, but not limited to, Sync and geolocation. From 77abc3b15f87293a7f8217b4a93d87a14846575e Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Tue, 5 Oct 2021 17:10:57 -0400 Subject: [PATCH 045/659] update to 94.0.4606.71 --- chromium-94.0.4606.71-InkDropHost-crash.patch | 24 +++++++++++++++++++ chromium.spec | 8 ++++++- sources | 2 +- 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 chromium-94.0.4606.71-InkDropHost-crash.patch diff --git a/chromium-94.0.4606.71-InkDropHost-crash.patch b/chromium-94.0.4606.71-InkDropHost-crash.patch new file mode 100644 index 0000000..b5e2794 --- /dev/null +++ b/chromium-94.0.4606.71-InkDropHost-crash.patch @@ -0,0 +1,24 @@ +diff -up chromium-94.0.4606.71/ui/views/animation/ink_drop_host_view.h.InkDropHost-crash chromium-94.0.4606.71/ui/views/animation/ink_drop_host_view.h +--- chromium-94.0.4606.71/ui/views/animation/ink_drop_host_view.h.InkDropHost-crash 2021-10-05 16:04:46.313586509 -0400 ++++ chromium-94.0.4606.71/ui/views/animation/ink_drop_host_view.h 2021-10-05 16:05:12.213732558 -0400 +@@ -228,6 +228,11 @@ class VIEWS_EXPORT InkDropHost { + // Used to observe View and inform the InkDrop of host-transform changes. + ViewLayerTransformObserver host_view_transform_observer_; + ++ // Declared before |ink_drop_|, because InkDropImpl may call ++ // RemoveInkDropLayer on partly destructed InkDropHost. In ++ // that case |ink_drop_mask_| must be still valid. ++ std::unique_ptr ink_drop_mask_; ++ + // Should not be accessed directly. Use GetInkDrop() instead. + std::unique_ptr ink_drop_; + +@@ -249,8 +254,6 @@ class VIEWS_EXPORT InkDropHost { + int ink_drop_small_corner_radius_ = 2; + int ink_drop_large_corner_radius_ = 4; + +- std::unique_ptr ink_drop_mask_; +- + base::RepeatingCallback()> create_ink_drop_callback_; + base::RepeatingCallback()> + create_ink_drop_ripple_callback_; diff --git a/chromium.spec b/chromium.spec index 42404ca..149273e 100644 --- a/chromium.spec +++ b/chromium.spec @@ -222,7 +222,7 @@ Name: chromium%{chromium_channel}%{nsuffix} %else Name: chromium%{chromium_channel} %endif -Version: %{majorversion}.0.4606.61 +Version: %{majorversion}.0.4606.71 Release: 1%{?dist} %if %{?freeworld} %if %{?shared} @@ -334,6 +334,8 @@ Patch95: chromium-93.0.4577.63-mojo-header-fix.patch Patch96: chromium-94.0.4606.54-webrtc-BUILD.gn-fix-multiple-defines.patch # Fix extra qualification error Patch97: chromium-94.0.4606.61-remoting-extra-qualification.patch +# From gentoo +Patch98: chromium-94.0.4606.71-InkDropHost-crash.patch # Use lstdc++ on EPEL7 only @@ -1010,6 +1012,7 @@ udev. %patch95 -p1 -b .mojo-header-fix %patch96 -p1 -b .webrtc-BUILD.gn-fix-multiple-defines %patch97 -p1 -b .remoting-extra-qualification +%patch98 -p1 -b .InkDropHost-crash # Fedora branded user agent %if 0%{?fedora} @@ -2095,6 +2098,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Tue Oct 5 2021 Tom Callaway - 94.0.4606.71-1 +- update to 94.0.4606.71 + * Fri Sep 24 2021 Tom Callaway - 94.0.4606.61-1 - update to 94.0.4606.61 diff --git a/sources b/sources index e1d64f9..b0e0c93 100644 --- a/sources +++ b/sources @@ -21,4 +21,4 @@ SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1d SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a SHA512 (node-v12.22.6-linux-arm64.tar.xz) = 87ce5eb954deb1d0debe6fa02b28a3cc675e12fca1e51d44b123ab294aa39ce0c6b8ac9eae1e7a6e32673ea2c2d480651d9ba7eea73012f0529503eebe9eb34d SHA512 (node-v12.22.6-linux-x64.tar.xz) = e1b55c32343cb2ccc40d888c705414bebf9c46b02083d13731df79b1e79521b7277761f6bcca041e40e3a2e47c67bb8e7848aa2b919a9de5c2ebf62c4a9c7176 -SHA512 (chromium-94.0.4606.61-clean.tar.xz) = 376d619e4bc4d5a5641aaf22d855889465c9b8990dcbc83517548edc9ada2e7087b66e839090c82cbbe2d46c2e98dc7f4b6461390a1f0d1d298cc698d1736b5e +SHA512 (chromium-94.0.4606.71-clean.tar.xz) = efed6617109901bee04145772e34260a9c45bc72cc4274cac32db1330f22f3867bc934edf75d2f144e43e52bce052d1f1e0300c046d6d7d823c2a0341a9c6469 From 7ff4192252c3d72af0593210a619246db3355ccf Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Fri, 8 Oct 2021 11:13:28 -0400 Subject: [PATCH 046/659] use is_official_build=true --- ....0.4606.71-PartitionFree-nullptr-fix.patch | 15 ++++++++++ ...606.71-remoting-missing-cmath-header.patch | 11 +++++++ chromium.spec | 29 ++++++++++++++++--- sources | 24 --------------- 4 files changed, 51 insertions(+), 28 deletions(-) create mode 100644 chromium-94.0.4606.71-PartitionFree-nullptr-fix.patch create mode 100644 chromium-94.0.4606.71-remoting-missing-cmath-header.patch delete mode 100644 sources diff --git a/chromium-94.0.4606.71-PartitionFree-nullptr-fix.patch b/chromium-94.0.4606.71-PartitionFree-nullptr-fix.patch new file mode 100644 index 0000000..29777ef --- /dev/null +++ b/chromium-94.0.4606.71-PartitionFree-nullptr-fix.patch @@ -0,0 +1,15 @@ +diff -up chromium-94.0.4606.71/base/allocator/allocator_shim_default_dispatch_to_partition_alloc.cc.nullptr-fix chromium-94.0.4606.71/base/allocator/allocator_shim_default_dispatch_to_partition_alloc.cc +--- chromium-94.0.4606.71/base/allocator/allocator_shim_default_dispatch_to_partition_alloc.cc.nullptr-fix 2021-10-06 15:23:11.590602162 -0400 ++++ chromium-94.0.4606.71/base/allocator/allocator_shim_default_dispatch_to_partition_alloc.cc 2021-10-06 15:29:21.508762249 -0400 +@@ -380,7 +380,10 @@ void PartitionFree(const AllocatorDispat + size_t PartitionGetSizeEstimate(const AllocatorDispatch*, + void* address, + void* context) { +- PA_DCHECK(address); ++ // This is used to implement malloc_usable_size(3). Per its man page, "if ptr ++ // is NULL, 0 is returned". ++ if (!address) ++ return 0; + + #if defined(OS_APPLE) + if (!base::IsManagedByPartitionAlloc(address)) { diff --git a/chromium-94.0.4606.71-remoting-missing-cmath-header.patch b/chromium-94.0.4606.71-remoting-missing-cmath-header.patch new file mode 100644 index 0000000..060c71b --- /dev/null +++ b/chromium-94.0.4606.71-remoting-missing-cmath-header.patch @@ -0,0 +1,11 @@ +diff -up chromium-94.0.4606.71/remoting/codec/codec_test.cc.missing-header chromium-94.0.4606.71/remoting/codec/codec_test.cc +--- chromium-94.0.4606.71/remoting/codec/codec_test.cc.missing-header 2021-10-07 18:01:11.846157616 +0000 ++++ chromium-94.0.4606.71/remoting/codec/codec_test.cc 2021-10-07 18:01:22.913662166 +0000 +@@ -8,6 +8,7 @@ + #include + #include + ++#include + #include + #include + diff --git a/chromium.spec b/chromium.spec index 149273e..35f61e1 100644 --- a/chromium.spec +++ b/chromium.spec @@ -6,13 +6,16 @@ %endif # This flag is so I can build things very fast on a giant system. -# Do not enable in Koji builds. +# Koji now likes this (as long as I don't build for every target at once). %global use_all_cpus 1 %if %{use_all_cpus} %global numjobs %{_smp_build_ncpus} %endif +# official builds have less debugging and go faster... but we have to shut some things off. +%global official_build 1 + # Fancy build status, so we at least know, where we are.. # %1 where # %2 what @@ -223,7 +226,7 @@ Name: chromium%{chromium_channel}%{nsuffix} Name: chromium%{chromium_channel} %endif Version: %{majorversion}.0.4606.71 -Release: 1%{?dist} +Release: 2%{?dist} %if %{?freeworld} %if %{?shared} # chromium-libs-media-freeworld @@ -310,13 +313,15 @@ Patch79: chromium-93.0.4577.63-widevine-no-download.patch # Fix crashes with components/cast_* # Thanks to Gentoo Patch80: chromium-92.0.4515.107-EnumTable-crash.patch - # https://github.com/stha09/chromium-patches/blob/master/chromium-94-ConversionStorageSql-lambda.patch Patch81: chromium-94-ConversionStorageSql-lambda.patch # https://github.com/stha09/chromium-patches/blob/master/chromium-94-CustomSpaces-include.patch Patch82: chromium-94-CustomSpaces-include.patch # Fixes for python3 Patch83: chromium-92.0.4515.107-py3-fixes.patch +# Add missing cmath header +Patch84: chromium-94.0.4606.71-remoting-missing-cmath-header.patch + # Clean up clang-format for python3 # thanks to Jon Nettleton Patch86: chromium-93.0.4577.63-clang-format.patch @@ -336,6 +341,10 @@ Patch96: chromium-94.0.4606.54-webrtc-BUILD.gn-fix-multiple-defines.patch Patch97: chromium-94.0.4606.61-remoting-extra-qualification.patch # From gentoo Patch98: chromium-94.0.4606.71-InkDropHost-crash.patch +# From upstream +# https://chromium.googlesource.com/chromium/src/+/403393b908cefaed09592a4f25fe2cbd46317a68%5E%21/#F0 +Patch99: chromium-94.0.4606.71-PartitionFree-nullptr-fix.patch + # Use lstdc++ on EPEL7 only @@ -1006,6 +1015,7 @@ udev. %patch81 -p1 -b .ConversionStorageSql-lambda-include %patch82 -p1 -b .CustomSpaces-include %patch83 -p1 -b .py3fixes +%patch84 -p1 -b .remoting-missing-cmath-header %patch86 -p1 -b .clang-format-py3 %patch93 -p1 -b .vector-fix %patch94 -p1 -b .remoting-nodestructor-fix @@ -1013,6 +1023,7 @@ udev. %patch96 -p1 -b .webrtc-BUILD.gn-fix-multiple-defines %patch97 -p1 -b .remoting-extra-qualification %patch98 -p1 -b .InkDropHost-crash +%patch99 -p1 -b .PartitionFree-nullptr-fix # Fedora branded user agent %if 0%{?fedora} @@ -1145,6 +1156,10 @@ CHROMIUM_CORE_GN_DEFINES+=' is_debug=false' %ifarch x86_64 aarch64 CHROMIUM_CORE_GN_DEFINES+=' system_libdir="lib64"' %endif +%if %{official_build} +CHROMIUM_CORE_GN_DEFINES+=' is_official_build=true use_thin_lto=false is_cfi=false chrome_pgo_phase=0 use_debug_fission=true' +sed -i 's|OFFICIAL_BUILD|GOOGLE_CHROME_BUILD|g' tools/generate_shim_headers/generate_shim_headers.py +%endif %if %{useapikey} CHROMIUM_CORE_GN_DEFINES+=' google_api_key="%{api_key}"' %endif @@ -2039,9 +2054,11 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %lang(zh_CN) %{chromium_path}/locales/zh-CN.pak* %lang(zh_TW) %{chromium_path}/locales/zh-TW.pak* # These are psuedolocales, not real ones. -# So we just include them always. +# They only get generated when is_official_build=false +%if ! %{official_build} %{chromium_path}/locales/ar-XB.pak* %{chromium_path}/locales/en-XA.pak* +%endif %if %{build_headless} %files headless @@ -2098,6 +2115,10 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Wed Oct 6 2021 Tom Callaway - 94.0.4606.71-2 +- add official_build flag +- apply upstream patch to handle nullptr correctly in PartitionGetSizeEstimate() + * Tue Oct 5 2021 Tom Callaway - 94.0.4606.71-1 - update to 94.0.4606.71 diff --git a/sources b/sources deleted file mode 100644 index b0e0c93..0000000 --- a/sources +++ /dev/null @@ -1,24 +0,0 @@ -SHA512 (gelasio.zip) = 0a22def3eca8848161ee72453dc5f97cc52ed09ffe21834152f2535d3a71f404cdf1f6e1809564bacb86aae75278cbcb96cae52b537d3ccdc299b60d6d0bc53e -SHA512 (MuktiNarrow-0.94.tar.bz2) = f7abd429e2591eaa047d1ac982d97fa67dc1480c42e55b2a97861abd90918704dce90b6bb27dec7b6d696f188017a74de54a7b7f45281f0515923b90300959d1 -SHA512 (NotoSansCJKjp-hinted.zip) = e7bcbc53a10b8ec3679dcade5a8a94cea7e1f60875ab38f2193b4fa8e33968e1f0abc8184a3df1e5210f6f5c731f96c727c6aa8f519423a29707d2dee5ada193 -SHA512 (lohit-gurmukhi-ttf-2.91.2.tar.gz) = 714ed72d201e7f8956d24e9d9f1526207beb91a604e88c02a8b0d145f19d9bfe1408ca290d1665ebef462ab3854365dcd9850529803277738e2585addf3e280a -SHA512 (Arimo-BoldItalic.ttf) = cb1f411f2630f2754dfb0244b3c56fde43650d603512d47c143bc0f24028da4d7ca2b35a633226ef9c502b97c63cfbd5a6d696934b3e60b2a98ad879b113a4c4 -SHA512 (Arimo-Bold.ttf) = 2853e5f41e6899baf226db2578aba09f2f88085eaea02da024621492d21e1af8bdefdefd354ea23dc4d5de5cb0d554085040a0108820f213e86dd532986fdb41 -SHA512 (Arimo-Italic.ttf) = 56ef918e5811dcd375e6cd8d79dc69f4db75d544639c0f6ac3a0343b3b4ef94b7dee5a6066f1558d8747a32bbee074256be68b943ff31cfbd2f5f32acfa7c1c5 -SHA512 (Arimo-Regular.ttf) = 05e6aa6b785b0038a8e0e0a8a618a1b8e907a700be302148eaebc91cfac3c9e2d9acf90b9d077ff3b9ff54bd5f8a9c522a039cff6103cdeee54be29b6a0b355f -SHA512 (Cousine-BoldItalic.ttf) = 2125aa9f5db4ae4a3725d308b6afbfbce5957f3c96a3c5fcba8ebf5cd167017d9c7023391e947ed68d12fa97e2cba3f156a3acca276d9f5ed50df7d78c07f918 -SHA512 (Cousine-Bold.ttf) = 1759fd23419ae0e1bfc9be92abb9cb0c74084ce85e7f53c055d86ec3d62da83169d0d67ed96fd4e496b28acf382933d63448459108b109d8202db7f18f05caab -SHA512 (Cousine-Italic.ttf) = ec3fc9d940b748dbbc64aa66184413a78ae2b085181eed563449df044b891e951e8feebd865be5be42f0cd001acf5bdce9084a006f9b5be32f096f7df0dc7700 -SHA512 (Cousine-Regular.ttf) = a665a6a4a5583079eb87509e2da7d6bd06965e6a7655217302b088caef942ae9ad63e6cffda18d0001fc9ab2284836766843e46bfdacd188b54f39d7855f36a0 -SHA512 (Tinos-BoldItalic.ttf) = 2574de2add94ef976b731fac688951fab49574c9b0ccd259ba647ea3598ca026bcfb88e2ea3f19effb3af71fdc0eb5fa9973f0b6e996c22185c5f2aab5a23fdd -SHA512 (Tinos-Bold.ttf) = 54aeca804c06a4d5c57ade596e73df91a6a1c4401c4aadba55d987b3fb73045d35f3df02678b59abb77c4914ec741755536c0adf808c931e4b77848c52c229c4 -SHA512 (Tinos-Italic.ttf) = d4f4f096110ef98a781a2a0e0d319317e5f84e650fe6f4d4f6b0e22a16414278217f37497b904a18540273c0e2d79d4f1faabde3b0eb5446283b318c73bafb38 -SHA512 (Tinos-Regular.ttf) = 58085c5dac6d067d60ba2ab3220c4a0cc1efcf279cadfcfb8746a5e5fa1a6f6daa62750dc2051b3b2d8a51b4d2e9bb0f66594caf2253c0870ed9c7286fa45e8f -SHA512 (Ahem.ttf) = aeb64b10ab9c87860714cb60b4900254b13dc52c51319256a1a3722c882026ab7c616bf628fbc2fe14e38a6003f3a481af60b52a7ed62071d28ddaf428e4e3fd -SHA512 (xcb-proto-1.14.tar.xz) = de66d568163b6da2be9d6c59984f3afa3acd119a781378638045fd68018665ef5c9af98f024e9962ba3eb7c7a4d85c27ba70ffafceb2324ccc6940f34de16690 -SHA512 (depot_tools.git-master.tar.gz) = dc323888812b66cc92c53a24a8a58ccf9e2961be67aa21852bd091b8b49569071f06ae9104cb58950e6253ac3a29f0db0663e9f35ef2b1ea28696efb38b42708 -SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1dc09f5a0fd7898e9d0a372ee4422b6b1cdab3c86ecc91db437e9ae8a951e64e85edc3ac9e9fca428852dbb2ad -SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a -SHA512 (node-v12.22.6-linux-arm64.tar.xz) = 87ce5eb954deb1d0debe6fa02b28a3cc675e12fca1e51d44b123ab294aa39ce0c6b8ac9eae1e7a6e32673ea2c2d480651d9ba7eea73012f0529503eebe9eb34d -SHA512 (node-v12.22.6-linux-x64.tar.xz) = e1b55c32343cb2ccc40d888c705414bebf9c46b02083d13731df79b1e79521b7277761f6bcca041e40e3a2e47c67bb8e7848aa2b919a9de5c2ebf62c4a9c7176 -SHA512 (chromium-94.0.4606.71-clean.tar.xz) = efed6617109901bee04145772e34260a9c45bc72cc4274cac32db1330f22f3867bc934edf75d2f144e43e52bce052d1f1e0300c046d6d7d823c2a0341a9c6469 From f0a2189889cfab93c70b3d7f778756b780172e74 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Fri, 8 Oct 2021 11:51:53 -0400 Subject: [PATCH 047/659] 94.0.4606.81 --- chromium-94.0.4606.81-clang-format.patch | 37 ++++++++++++++++++++++++ chromium.spec | 9 ++++-- sources | 24 +++++++++++++++ 3 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 chromium-94.0.4606.81-clang-format.patch create mode 100644 sources diff --git a/chromium-94.0.4606.81-clang-format.patch b/chromium-94.0.4606.81-clang-format.patch new file mode 100644 index 0000000..960e7a4 --- /dev/null +++ b/chromium-94.0.4606.81-clang-format.patch @@ -0,0 +1,37 @@ +diff -up chromium-94.0.4606.81/buildtools/linux64/clang-format.clang-format-py3 chromium-94.0.4606.81/buildtools/linux64/clang-format +--- chromium-94.0.4606.81/buildtools/linux64/clang-format.clang-format-py3 2021-10-08 11:26:16.411861005 -0400 ++++ chromium-94.0.4606.81/buildtools/linux64/clang-format 2021-10-08 11:32:16.005895508 -0400 +@@ -12,9 +12,9 @@ def main(): + args = sys.argv[1:] + inputfiles = [a for a in args if not a.startswith('-')] + +- contents = '' ++ contents = b'' + if '-' in args or not inputfiles: +- contents = sys.stdin.read() ++ contents = sys.stdin.buffer.read() + + # Tarball builds may or may not have depot_tools in $PATH. In the former case, + # running 'clang-format' will call back into this script infinitely. Strip off +@@ -37,17 +37,17 @@ def main(): + stdout, stderr = proc.communicate(input=contents) + # Ignore if clang-format fails. Eg: it may be too old to support C++14. + if proc.returncode == 0: +- sys.stdout.write(stdout) +- sys.stderr.write(stderr) ++ sys.stdout.buffer.write(stdout) ++ sys.stderr.buffer.write(stderr) + return 0 + except OSError: + # Ignore if clang-format is not installed. + pass + + # If any failure happens, continue with unformatted files. +- sys.stdout.write(contents) ++ sys.stdout.buffer.write(contents) + for inputfile in inputfiles: +- sys.stdout.write(open(inputfile).read()) ++ sys.stdout.buffer.write(open(inputfile).read()) + + return 0 + diff --git a/chromium.spec b/chromium.spec index 35f61e1..3339e19 100644 --- a/chromium.spec +++ b/chromium.spec @@ -225,8 +225,8 @@ Name: chromium%{chromium_channel}%{nsuffix} %else Name: chromium%{chromium_channel} %endif -Version: %{majorversion}.0.4606.71 -Release: 2%{?dist} +Version: %{majorversion}.0.4606.81 +Release: 1%{?dist} %if %{?freeworld} %if %{?shared} # chromium-libs-media-freeworld @@ -324,7 +324,7 @@ Patch84: chromium-94.0.4606.71-remoting-missing-cmath-header.patch # Clean up clang-format for python3 # thanks to Jon Nettleton -Patch86: chromium-93.0.4577.63-clang-format.patch +Patch86: chromium-94.0.4606.81-clang-format.patch # In file included from ../../components/cast_channel/enum_table.cc:5: # ../../components/cast_channel/enum_table.h:359:18: error: 'vector' in namespace 'std' does not name a template type # 359 | const std::vector data_; @@ -2115,6 +2115,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Fri Oct 8 2021 Tom Callaway - 94.0.4606.81-1 +- update to 94.0.4606.81 + * Wed Oct 6 2021 Tom Callaway - 94.0.4606.71-2 - add official_build flag - apply upstream patch to handle nullptr correctly in PartitionGetSizeEstimate() diff --git a/sources b/sources new file mode 100644 index 0000000..152d62b --- /dev/null +++ b/sources @@ -0,0 +1,24 @@ +SHA512 (gelasio.zip) = 0a22def3eca8848161ee72453dc5f97cc52ed09ffe21834152f2535d3a71f404cdf1f6e1809564bacb86aae75278cbcb96cae52b537d3ccdc299b60d6d0bc53e +SHA512 (MuktiNarrow-0.94.tar.bz2) = f7abd429e2591eaa047d1ac982d97fa67dc1480c42e55b2a97861abd90918704dce90b6bb27dec7b6d696f188017a74de54a7b7f45281f0515923b90300959d1 +SHA512 (NotoSansCJKjp-hinted.zip) = e7bcbc53a10b8ec3679dcade5a8a94cea7e1f60875ab38f2193b4fa8e33968e1f0abc8184a3df1e5210f6f5c731f96c727c6aa8f519423a29707d2dee5ada193 +SHA512 (lohit-gurmukhi-ttf-2.91.2.tar.gz) = 714ed72d201e7f8956d24e9d9f1526207beb91a604e88c02a8b0d145f19d9bfe1408ca290d1665ebef462ab3854365dcd9850529803277738e2585addf3e280a +SHA512 (Arimo-BoldItalic.ttf) = cb1f411f2630f2754dfb0244b3c56fde43650d603512d47c143bc0f24028da4d7ca2b35a633226ef9c502b97c63cfbd5a6d696934b3e60b2a98ad879b113a4c4 +SHA512 (Arimo-Bold.ttf) = 2853e5f41e6899baf226db2578aba09f2f88085eaea02da024621492d21e1af8bdefdefd354ea23dc4d5de5cb0d554085040a0108820f213e86dd532986fdb41 +SHA512 (Arimo-Italic.ttf) = 56ef918e5811dcd375e6cd8d79dc69f4db75d544639c0f6ac3a0343b3b4ef94b7dee5a6066f1558d8747a32bbee074256be68b943ff31cfbd2f5f32acfa7c1c5 +SHA512 (Arimo-Regular.ttf) = 05e6aa6b785b0038a8e0e0a8a618a1b8e907a700be302148eaebc91cfac3c9e2d9acf90b9d077ff3b9ff54bd5f8a9c522a039cff6103cdeee54be29b6a0b355f +SHA512 (Cousine-BoldItalic.ttf) = 2125aa9f5db4ae4a3725d308b6afbfbce5957f3c96a3c5fcba8ebf5cd167017d9c7023391e947ed68d12fa97e2cba3f156a3acca276d9f5ed50df7d78c07f918 +SHA512 (Cousine-Bold.ttf) = 1759fd23419ae0e1bfc9be92abb9cb0c74084ce85e7f53c055d86ec3d62da83169d0d67ed96fd4e496b28acf382933d63448459108b109d8202db7f18f05caab +SHA512 (Cousine-Italic.ttf) = ec3fc9d940b748dbbc64aa66184413a78ae2b085181eed563449df044b891e951e8feebd865be5be42f0cd001acf5bdce9084a006f9b5be32f096f7df0dc7700 +SHA512 (Cousine-Regular.ttf) = a665a6a4a5583079eb87509e2da7d6bd06965e6a7655217302b088caef942ae9ad63e6cffda18d0001fc9ab2284836766843e46bfdacd188b54f39d7855f36a0 +SHA512 (Tinos-BoldItalic.ttf) = 2574de2add94ef976b731fac688951fab49574c9b0ccd259ba647ea3598ca026bcfb88e2ea3f19effb3af71fdc0eb5fa9973f0b6e996c22185c5f2aab5a23fdd +SHA512 (Tinos-Bold.ttf) = 54aeca804c06a4d5c57ade596e73df91a6a1c4401c4aadba55d987b3fb73045d35f3df02678b59abb77c4914ec741755536c0adf808c931e4b77848c52c229c4 +SHA512 (Tinos-Italic.ttf) = d4f4f096110ef98a781a2a0e0d319317e5f84e650fe6f4d4f6b0e22a16414278217f37497b904a18540273c0e2d79d4f1faabde3b0eb5446283b318c73bafb38 +SHA512 (Tinos-Regular.ttf) = 58085c5dac6d067d60ba2ab3220c4a0cc1efcf279cadfcfb8746a5e5fa1a6f6daa62750dc2051b3b2d8a51b4d2e9bb0f66594caf2253c0870ed9c7286fa45e8f +SHA512 (Ahem.ttf) = aeb64b10ab9c87860714cb60b4900254b13dc52c51319256a1a3722c882026ab7c616bf628fbc2fe14e38a6003f3a481af60b52a7ed62071d28ddaf428e4e3fd +SHA512 (xcb-proto-1.14.tar.xz) = de66d568163b6da2be9d6c59984f3afa3acd119a781378638045fd68018665ef5c9af98f024e9962ba3eb7c7a4d85c27ba70ffafceb2324ccc6940f34de16690 +SHA512 (depot_tools.git-master.tar.gz) = dc323888812b66cc92c53a24a8a58ccf9e2961be67aa21852bd091b8b49569071f06ae9104cb58950e6253ac3a29f0db0663e9f35ef2b1ea28696efb38b42708 +SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1dc09f5a0fd7898e9d0a372ee4422b6b1cdab3c86ecc91db437e9ae8a951e64e85edc3ac9e9fca428852dbb2ad +SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a +SHA512 (node-v12.22.6-linux-arm64.tar.xz) = 87ce5eb954deb1d0debe6fa02b28a3cc675e12fca1e51d44b123ab294aa39ce0c6b8ac9eae1e7a6e32673ea2c2d480651d9ba7eea73012f0529503eebe9eb34d +SHA512 (node-v12.22.6-linux-x64.tar.xz) = e1b55c32343cb2ccc40d888c705414bebf9c46b02083d13731df79b1e79521b7277761f6bcca041e40e3a2e47c67bb8e7848aa2b919a9de5c2ebf62c4a9c7176 +SHA512 (chromium-94.0.4606.81-clean.tar.xz) = 4cc14e91b244d59b30931e7ff90e6a031784d1da9f2e3e72172757d0a76305ccd265f5456779bfcb893482d70a5cc86b52a0d26e255331505d5c2acc036f87e9 From 1568f25500740341450b793ec8b8430614befb65 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Sat, 9 Oct 2021 17:55:23 -0400 Subject: [PATCH 048/659] turn off debug symbols for i686 --- chromium.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chromium.spec b/chromium.spec index 3339e19..19ec6f9 100644 --- a/chromium.spec +++ b/chromium.spec @@ -1159,6 +1159,10 @@ CHROMIUM_CORE_GN_DEFINES+=' system_libdir="lib64"' %if %{official_build} CHROMIUM_CORE_GN_DEFINES+=' is_official_build=true use_thin_lto=false is_cfi=false chrome_pgo_phase=0 use_debug_fission=true' sed -i 's|OFFICIAL_BUILD|GOOGLE_CHROME_BUILD|g' tools/generate_shim_headers/generate_shim_headers.py +# Too much debuginfo for i686 +%ifarch i686 +sed -i 's|-g2|-g0|g' build/config/compiler/BUILD.gn +%endif %endif %if %{useapikey} CHROMIUM_CORE_GN_DEFINES+=' google_api_key="%{api_key}"' From fd994e0e99f8109e118f904992be11933b037c42 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Mon, 11 Oct 2021 11:32:30 -0400 Subject: [PATCH 049/659] turn off use_all_cpus to see if that fixes the aarch64 timeouts --- chromium.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chromium.spec b/chromium.spec index 19ec6f9..e7a7e8d 100644 --- a/chromium.spec +++ b/chromium.spec @@ -6,8 +6,8 @@ %endif # This flag is so I can build things very fast on a giant system. -# Koji now likes this (as long as I don't build for every target at once). -%global use_all_cpus 1 +# Enabling this in koji causes aarch64 builds to timeout indefinitely. +%global use_all_cpus 0 %if %{use_all_cpus} %global numjobs %{_smp_build_ncpus} From 9776d9fcfe4849ef19d21b659998f493468c1a72 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Tue, 12 Oct 2021 10:42:58 -0400 Subject: [PATCH 050/659] disable -g2 on aarch64 too because of space issues --- chromium.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chromium.spec b/chromium.spec index e7a7e8d..a028ca9 100644 --- a/chromium.spec +++ b/chromium.spec @@ -1159,8 +1159,8 @@ CHROMIUM_CORE_GN_DEFINES+=' system_libdir="lib64"' %if %{official_build} CHROMIUM_CORE_GN_DEFINES+=' is_official_build=true use_thin_lto=false is_cfi=false chrome_pgo_phase=0 use_debug_fission=true' sed -i 's|OFFICIAL_BUILD|GOOGLE_CHROME_BUILD|g' tools/generate_shim_headers/generate_shim_headers.py -# Too much debuginfo for i686 -%ifarch i686 +# Too much debuginfo for i686 and aarch64 +%ifarch i686 aarch64 sed -i 's|-g2|-g0|g' build/config/compiler/BUILD.gn %endif %endif From 13a9fbb3c619085e0b877cab58f7f3fc0da981f2 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Thu, 14 Oct 2021 10:30:15 -0400 Subject: [PATCH 051/659] try to turn the number of jobs down so i686 does not OOM --- chromium.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chromium.spec b/chromium.spec index a028ca9..9605394 100644 --- a/chromium.spec +++ b/chromium.spec @@ -1,7 +1,7 @@ %define _lto_cflags %{nil} %global numjobs 10 -%ifarch aarch64 +%ifarch aarch64 i686 %global numjobs 8 %endif From 977aafb453e7c2aff2d1ac22b10b3ac3ea22e92f Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Tue, 19 Oct 2021 11:12:14 -0400 Subject: [PATCH 052/659] try use_gold for i686? --- chromium.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/chromium.spec b/chromium.spec index 9605394..91a0541 100644 --- a/chromium.spec +++ b/chromium.spec @@ -54,6 +54,12 @@ # Seems like we might need this sometimes # Practically, no. But it's here in case we do. %global use_gold 0 +# Lets see if gold gets us past this old corner case. +%if 0%{?fedora} == 33 +%ifarch i686 +%global use_gold 1 +%endif +%endif # 2020-08-20: F33+ aarch64 has a binutils bug trying to link clear_key_cdm # https://bugzilla.redhat.com/show_bug.cgi?id=1869884 From a7cb5d2535f713caaccdbf66ffa1a7355efae86b Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Tue, 19 Oct 2021 14:18:42 -0400 Subject: [PATCH 053/659] gold did not work, trying to use -O1 instead of -O3 via a hack --- chromium.spec | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/chromium.spec b/chromium.spec index 91a0541..531ae28 100644 --- a/chromium.spec +++ b/chromium.spec @@ -23,7 +23,6 @@ export NINJA_STATUS="[%2:%f/%t] " ; \ ../depot_tools/ninja -j %{numjobs} -C '%1' -vvv '%2' - # This was faster when it worked, but it didn't always. # As of chromium 80, it is no longer supported. RIP. %global use_jumbo 0 @@ -54,12 +53,6 @@ # Seems like we might need this sometimes # Practically, no. But it's here in case we do. %global use_gold 0 -# Lets see if gold gets us past this old corner case. -%if 0%{?fedora} == 33 -%ifarch i686 -%global use_gold 1 -%endif -%endif # 2020-08-20: F33+ aarch64 has a binutils bug trying to link clear_key_cdm # https://bugzilla.redhat.com/show_bug.cgi?id=1869884 @@ -1200,6 +1193,13 @@ CHROMIUM_CORE_GN_DEFINES+=' use_jumbo_build=true jumbo_file_merge_limit=8' %if 0%{?rhel} == 8 CHROMIUM_CORE_GN_DEFINES+=' use_gnome_keyring=false use_glib=true' %endif +# This is a super disgusting hack to try to get i686 to build on Fedora 33 +# This flag switches it from -O3 to -O1. +%if 0%{?fedora} == 33 +%ifarch i686 +CHROMIUM_CORE_GN_DEFINES+=' optimize_for_fuzzing=true' +%endif +%endif export CHROMIUM_CORE_GN_DEFINES CHROMIUM_BROWSER_GN_DEFINES="" From fae6929da3743e8dcb96217fd69926471d9989ed Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Tue, 19 Oct 2021 16:23:18 -0400 Subject: [PATCH 054/659] drop i686 in Fedora 35+ --- chromium.spec | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/chromium.spec b/chromium.spec index 531ae28..46fd497 100644 --- a/chromium.spec +++ b/chromium.spec @@ -736,11 +736,19 @@ Provides: chromium-libs = %{version}-%{release} Obsoletes: chromium-libs <= %{version}-%{release} %endif +#rhel 7: ia32 x86_64 +#rhel 8+: ia32, x86_64, aarch64 +#fedora 34 or older: ia32, x86_64, aarch64 +#fedora 35+: x86_64 aarch64 only %if 0%{?rhel} == 7 ExclusiveArch: x86_64 i686 %else +%if 0%{?fedora} > 34 +ExclusiveArch: x86_64 aarch64 +%else ExclusiveArch: x86_64 i686 aarch64 %endif +%endif # Bundled bits (I'm sure I've missed some) Provides: bundled(angle) = 2422 From 39bdfb25f93a5aaf66a68d67b93984ef53adc313 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Wed, 20 Oct 2021 15:59:40 -0400 Subject: [PATCH 055/659] hack for low-mem failures on F33 i686 --- ...94.0.4606.81-i686-low-memory-linking-hacks.patch | 13 +++++++++++++ chromium.spec | 8 ++++++++ 2 files changed, 21 insertions(+) create mode 100644 chromium-94.0.4606.81-i686-low-memory-linking-hacks.patch diff --git a/chromium-94.0.4606.81-i686-low-memory-linking-hacks.patch b/chromium-94.0.4606.81-i686-low-memory-linking-hacks.patch new file mode 100644 index 0000000..a2cf7af --- /dev/null +++ b/chromium-94.0.4606.81-i686-low-memory-linking-hacks.patch @@ -0,0 +1,13 @@ +diff -up chromium-94.0.4606.81/build/config/compiler/BUILD.gn.i686-hack chromium-94.0.4606.81/build/config/compiler/BUILD.gn +--- chromium-94.0.4606.81/build/config/compiler/BUILD.gn.i686-hack 2021-10-20 15:56:09.409349920 -0400 ++++ chromium-94.0.4606.81/build/config/compiler/BUILD.gn 2021-10-20 15:57:30.409831217 -0400 +@@ -360,6 +360,9 @@ config("compiler") { + if (fatal_linker_warnings && is_apple) { + ldflags += [ "-Wl,-fatal_warnings" ] + } ++ ++ ldflags += [ "-Wl,--no-keep-memory" ] ++ ldflags += [ "-Wl,--reduce-memory-overheads" ] + } + + if (is_clang && is_debug) { diff --git a/chromium.spec b/chromium.spec index 46fd497..6e2ecb7 100644 --- a/chromium.spec +++ b/chromium.spec @@ -272,6 +272,8 @@ Patch11: chromium-92.0.4515.107-py2-bootstrap.patch # Add "Fedora" to the user agent string Patch12: chromium-86.0.4240.75-fedora-user-agent.patch +# Hack for low-mem failures on Fedora 33 i686 +Patch50: chromium-94.0.4606.81-i686-low-memory-linking-hacks.patch # Needs to be submitted.. Patch51: chromium-76.0.3809.100-gcc-remoting-constexpr.patch # https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/files/chromium-unbundle-zlib.patch @@ -996,6 +998,12 @@ udev. %patch11 -p1 -b .py3 %endif +%if 0%{?fedora} == 33 +%ifarch i686 +%patch50 -p1 -b .i686-hack +%endif +%endif + # Short term fixes (usually gcc and backports) %patch51 -p1 -b .gcc-remoting-constexpr %if 0%{?fedora} || 0%{?rhel} >= 8 From f274478b7ef73aaf7594b91f72f521283674d838 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Thu, 21 Oct 2021 11:06:09 -0400 Subject: [PATCH 056/659] fine, disable i686 in Fedora 33+ --- chromium.spec | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/chromium.spec b/chromium.spec index 6e2ecb7..900fc91 100644 --- a/chromium.spec +++ b/chromium.spec @@ -272,8 +272,6 @@ Patch11: chromium-92.0.4515.107-py2-bootstrap.patch # Add "Fedora" to the user agent string Patch12: chromium-86.0.4240.75-fedora-user-agent.patch -# Hack for low-mem failures on Fedora 33 i686 -Patch50: chromium-94.0.4606.81-i686-low-memory-linking-hacks.patch # Needs to be submitted.. Patch51: chromium-76.0.3809.100-gcc-remoting-constexpr.patch # https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/files/chromium-unbundle-zlib.patch @@ -740,12 +738,12 @@ Obsoletes: chromium-libs <= %{version}-%{release} #rhel 7: ia32 x86_64 #rhel 8+: ia32, x86_64, aarch64 -#fedora 34 or older: ia32, x86_64, aarch64 -#fedora 35+: x86_64 aarch64 only +#fedora 32 or older: ia32, x86_64, aarch64 +#fedora 33+: x86_64 aarch64 only %if 0%{?rhel} == 7 ExclusiveArch: x86_64 i686 %else -%if 0%{?fedora} > 34 +%if 0%{?fedora} > 32 ExclusiveArch: x86_64 aarch64 %else ExclusiveArch: x86_64 i686 aarch64 @@ -998,12 +996,6 @@ udev. %patch11 -p1 -b .py3 %endif -%if 0%{?fedora} == 33 -%ifarch i686 -%patch50 -p1 -b .i686-hack -%endif -%endif - # Short term fixes (usually gcc and backports) %patch51 -p1 -b .gcc-remoting-constexpr %if 0%{?fedora} || 0%{?rhel} >= 8 @@ -1209,13 +1201,6 @@ CHROMIUM_CORE_GN_DEFINES+=' use_jumbo_build=true jumbo_file_merge_limit=8' %if 0%{?rhel} == 8 CHROMIUM_CORE_GN_DEFINES+=' use_gnome_keyring=false use_glib=true' %endif -# This is a super disgusting hack to try to get i686 to build on Fedora 33 -# This flag switches it from -O3 to -O1. -%if 0%{?fedora} == 33 -%ifarch i686 -CHROMIUM_CORE_GN_DEFINES+=' optimize_for_fuzzing=true' -%endif -%endif export CHROMIUM_CORE_GN_DEFINES CHROMIUM_BROWSER_GN_DEFINES="" From 9de3cc7e1f30a26dc6a55324c68d0ccb2bf1f40b Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Mon, 15 Nov 2021 14:34:13 -0500 Subject: [PATCH 057/659] 95.0.4638.69 --- ...mium-77.0.3865.75-gcc-include-memory.patch | 23 -- chromium-95-BitstreamReader-namespace.patch | 41 ++++ chromium-95-eigen-avx-1.patch | 229 ++++++++++++++++++ chromium-95-eigen-avx-2.patch | 30 +++ chromium-95-eigen-avx-3.patch | 44 ++++ chromium-95-libyuv-aarch64.patch | 30 +++ chromium-95-maldoca-zlib.patch | 13 + chromium-95-quiche-include.patch | 25 ++ chromium-95-xfce-maximize.patch | 30 +++ chromium-95.0.4638.69-missing-cstring.patch | 57 +++++ chromium-95.0.4638.69-norar.patch | 90 +++++++ chromium.spec | 57 +++-- sources | 2 +- 13 files changed, 629 insertions(+), 42 deletions(-) delete mode 100644 chromium-77.0.3865.75-gcc-include-memory.patch create mode 100644 chromium-95-BitstreamReader-namespace.patch create mode 100644 chromium-95-eigen-avx-1.patch create mode 100644 chromium-95-eigen-avx-2.patch create mode 100644 chromium-95-eigen-avx-3.patch create mode 100644 chromium-95-libyuv-aarch64.patch create mode 100644 chromium-95-maldoca-zlib.patch create mode 100644 chromium-95-quiche-include.patch create mode 100644 chromium-95-xfce-maximize.patch create mode 100644 chromium-95.0.4638.69-missing-cstring.patch create mode 100644 chromium-95.0.4638.69-norar.patch diff --git a/chromium-77.0.3865.75-gcc-include-memory.patch b/chromium-77.0.3865.75-gcc-include-memory.patch deleted file mode 100644 index 67b3b44..0000000 --- a/chromium-77.0.3865.75-gcc-include-memory.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -up chromium-77.0.3865.75/third_party/one_euro_filter/src/one_euro_filter.h.gcc-include-memory chromium-77.0.3865.75/third_party/one_euro_filter/src/one_euro_filter.h ---- chromium-77.0.3865.75/third_party/one_euro_filter/src/one_euro_filter.h.gcc-include-memory 2019-09-13 14:44:24.962770079 +0200 -+++ chromium-77.0.3865.75/third_party/one_euro_filter/src/one_euro_filter.h 2019-09-13 14:44:45.347073612 +0200 -@@ -3,6 +3,8 @@ - - #include "low_pass_filter.h" - -+#include -+ - namespace one_euro_filter { - namespace test { - class OneEuroFilterTest; -diff -up chromium-80.0.3987.106/third_party/webrtc/modules/audio_processing/aec3/reverb_model_estimator.h.missing-memory chromium-80.0.3987.106/third_party/webrtc/modules/audio_processing/aec3/reverb_model_estimator.h ---- chromium-80.0.3987.106/third_party/webrtc/modules/audio_processing/aec3/reverb_model_estimator.h.missing-memory 2020-02-21 12:25:17.206021379 -0500 -+++ chromium-80.0.3987.106/third_party/webrtc/modules/audio_processing/aec3/reverb_model_estimator.h 2020-02-21 12:25:31.613759976 -0500 -@@ -12,6 +12,7 @@ - #define MODULES_AUDIO_PROCESSING_AEC3_REVERB_MODEL_ESTIMATOR_H_ - - #include -+#include - #include - - #include "absl/types/optional.h" diff --git a/chromium-95-BitstreamReader-namespace.patch b/chromium-95-BitstreamReader-namespace.patch new file mode 100644 index 0000000..5a42614 --- /dev/null +++ b/chromium-95-BitstreamReader-namespace.patch @@ -0,0 +1,41 @@ +From c23f09d436b566934d02c26a19e3cf5d31545855 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Sat, 4 Sep 2021 17:02:00 +0000 +Subject: [PATCH] GCC: fix template specialization in webrtc::BitstreamReader + +GCC complains that explicit specialization in non-namespace scope +is happening for webrtc::BitstreamReader::Read(). However, specialization +for bool isn't used because std::is_unsigned::value returns true. +Add std::is_same for bool check and enable second specialization only +for bool types. + +--- + third_party/webrtc/rtc_base/bitstream_reader.h | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/third_party/webrtc/rtc_base/bitstream_reader.h b/third_party/webrtc/rtc_base/bitstream_reader.h +index 8c0f66f..cd8537f 100644 +--- a/third_party/webrtc/rtc_base/bitstream_reader.h ++++ b/third_party/webrtc/rtc_base/bitstream_reader.h +@@ -61,14 +61,16 @@ class BitstreamReader { + // Reads unsigned integer of fixed width. + template ::value && ++ !std::is_same::value && + sizeof(T) <= 8>::type* = nullptr> + ABSL_MUST_USE_RESULT T Read() { + return rtc::dchecked_cast(ReadBits(sizeof(T) * 8)); + } + + // Reads single bit as boolean. +- template <> +- ABSL_MUST_USE_RESULT bool Read() { ++ template ::value>::type* = nullptr> ++ ABSL_MUST_USE_RESULT bool Read() { + return ReadBit() != 0; + } + +-- +2.32.0 + diff --git a/chromium-95-eigen-avx-1.patch b/chromium-95-eigen-avx-1.patch new file mode 100644 index 0000000..21d520c --- /dev/null +++ b/chromium-95-eigen-avx-1.patch @@ -0,0 +1,229 @@ +From 3d4ba855e014987cad86d62a8dff533492255695 Mon Sep 17 00:00:00 2001 +From: Antonio Sanchez +Date: Wed, 1 Sep 2021 14:11:21 -0700 +Subject: [PATCH] Fix AVX integer packet issues. + +Most are instances of AVX2 functions not protected by +`EIGEN_VECTORIZE_AVX2`. There was also a missing semi-colon +for AVX512. +--- + Eigen/src/Core/arch/AVX/PacketMath.h | 83 ++++++++++++++++++------- + Eigen/src/Core/arch/AVX512/PacketMath.h | 6 +- + 2 files changed, 63 insertions(+), 26 deletions(-) + +diff --git a/third_party/eigen3/src/Eigen/src/Core/arch/AVX/PacketMath.h b/third_party/eigen3/src/Eigen/src/Core/arch/AVX/PacketMath.h +index dc1a1d6b0..247ee4efd 100644 +--- a/third_party/eigen3/src/Eigen/src/Core/arch/AVX/PacketMath.h ++++ b/third_party/eigen3/src/Eigen/src/Core/arch/AVX/PacketMath.h +@@ -262,10 +262,6 @@ template<> EIGEN_STRONG_INLINE Packet4d peven_mask(const Packet4d& /*a*/) { retu + template<> EIGEN_STRONG_INLINE Packet8f pload1(const float* from) { return _mm256_broadcast_ss(from); } + template<> EIGEN_STRONG_INLINE Packet4d pload1(const double* from) { return _mm256_broadcast_sd(from); } + +-template<> EIGEN_STRONG_INLINE Packet8f plset(const float& a) { return _mm256_add_ps(_mm256_set1_ps(a), _mm256_set_ps(7.0,6.0,5.0,4.0,3.0,2.0,1.0,0.0)); } +-template<> EIGEN_STRONG_INLINE Packet4d plset(const double& a) { return _mm256_add_pd(_mm256_set1_pd(a), _mm256_set_pd(3.0,2.0,1.0,0.0)); } +-template<> EIGEN_STRONG_INLINE Packet8i plset(const int& a) { return _mm256_add_epi32(_mm256_set1_epi32(a), _mm256_set_epi32(7,6,5,4,3,2,1,0)); } +- + template<> EIGEN_STRONG_INLINE Packet8f padd(const Packet8f& a, const Packet8f& b) { return _mm256_add_ps(a,b); } + template<> EIGEN_STRONG_INLINE Packet4d padd(const Packet4d& a, const Packet4d& b) { return _mm256_add_pd(a,b); } + template<> EIGEN_STRONG_INLINE Packet8i padd(const Packet8i& a, const Packet8i& b) { +@@ -278,6 +274,10 @@ template<> EIGEN_STRONG_INLINE Packet8i padd(const Packet8i& a, const + #endif + } + ++template<> EIGEN_STRONG_INLINE Packet8f plset(const float& a) { return padd(pset1(a), _mm256_set_ps(7.0,6.0,5.0,4.0,3.0,2.0,1.0,0.0)); } ++template<> EIGEN_STRONG_INLINE Packet4d plset(const double& a) { return padd(pset1(a), _mm256_set_pd(3.0,2.0,1.0,0.0)); } ++template<> EIGEN_STRONG_INLINE Packet8i plset(const int& a) { return padd(pset1(a), _mm256_set_epi32(7,6,5,4,3,2,1,0)); } ++ + template<> EIGEN_STRONG_INLINE Packet8f psub(const Packet8f& a, const Packet8f& b) { return _mm256_sub_ps(a,b); } + template<> EIGEN_STRONG_INLINE Packet4d psub(const Packet4d& a, const Packet4d& b) { return _mm256_sub_pd(a,b); } + template<> EIGEN_STRONG_INLINE Packet8i psub(const Packet8i& a, const Packet8i& b) { +@@ -300,7 +300,7 @@ template<> EIGEN_STRONG_INLINE Packet4d pnegate(const Packet4d& a) + } + template<> EIGEN_STRONG_INLINE Packet8i pnegate(const Packet8i& a) + { +- return _mm256_sub_epi32(_mm256_set1_epi32(0), a); ++ return psub(pzero(a), a); + } + + template<> EIGEN_STRONG_INLINE Packet8f pconj(const Packet8f& a) { return a; } +@@ -419,7 +419,13 @@ template<> EIGEN_STRONG_INLINE Packet4d pmin(const Packet4d& a, const + #endif + } + template<> EIGEN_STRONG_INLINE Packet8i pmin(const Packet8i& a, const Packet8i& b) { ++#ifdef EIGEN_VECTORIZE_AVX2 + return _mm256_min_epi32(a, b); ++#else ++ __m128i lo = _mm_min_epi32(_mm256_extractf128_si256(a, 0), _mm256_extractf128_si256(b, 0)); ++ __m128i hi = _mm_min_epi32(_mm256_extractf128_si256(a, 1), _mm256_extractf128_si256(b, 1)); ++ return _mm256_insertf128_si256(_mm256_castsi128_si256(lo), (hi), 1); ++#endif + } + + template<> EIGEN_STRONG_INLINE Packet8f pmax(const Packet8f& a, const Packet8f& b) { +@@ -445,7 +451,13 @@ template<> EIGEN_STRONG_INLINE Packet4d pmax(const Packet4d& a, const + #endif + } + template<> EIGEN_STRONG_INLINE Packet8i pmax(const Packet8i& a, const Packet8i& b) { ++#ifdef EIGEN_VECTORIZE_AVX2 + return _mm256_max_epi32(a, b); ++#else ++ __m128i lo = _mm_max_epi32(_mm256_extractf128_si256(a, 0), _mm256_extractf128_si256(b, 0)); ++ __m128i hi = _mm_max_epi32(_mm256_extractf128_si256(a, 1), _mm256_extractf128_si256(b, 1)); ++ return _mm256_insertf128_si256(_mm256_castsi128_si256(lo), (hi), 1); ++#endif + } + + // Add specializations for min/max with prescribed NaN progation. +@@ -641,17 +653,25 @@ template<> EIGEN_STRONG_INLINE Packet8f ploaddup(const float* from) + // then we can perform a consistent permutation on the global register to get everything in shape: + return _mm256_permute_ps(tmp, _MM_SHUFFLE(3,3,2,2)); + } +-// Loads 2 doubles from memory a returns the packet {a0, a0 a1, a1} ++// Loads 2 doubles from memory a returns the packet {a0, a0, a1, a1} + template<> EIGEN_STRONG_INLINE Packet4d ploaddup(const double* from) + { + Packet4d tmp = _mm256_broadcast_pd((const __m128d*)(const void*)from); + return _mm256_permute_pd(tmp, 3<<2); + } +-// Loads 4 integers from memory a returns the packet {a0, a0 a1, a1, a2, a2, a3, a3} ++// Loads 4 integers from memory a returns the packet {a0, a0, a1, a1, a2, a2, a3, a3} + template<> EIGEN_STRONG_INLINE Packet8i ploaddup(const int* from) + { +- Packet8i a = _mm256_castsi128_si256(pload(from)); ++#ifdef EIGEN_VECTORIZE_AVX2 ++ const Packet8i a = _mm256_castsi128_si256(pload(from)); + return _mm256_permutevar8x32_epi32(a, _mm256_setr_epi32(0, 0, 1, 1, 2, 2, 3, 3)); ++#else ++ __m256 tmp = _mm256_broadcast_ps((const __m128*)(const void*)from); ++ // mimic an "inplace" permutation of the lower 128bits using a blend ++ tmp = _mm256_blend_ps(tmp,_mm256_castps128_ps256(_mm_permute_ps( _mm256_castps256_ps128(tmp), _MM_SHUFFLE(1,0,1,0))), 15); ++ // then we can perform a consistent permutation on the global register to get everything in shape: ++ return _mm256_castps_si256(_mm256_permute_ps(tmp, _MM_SHUFFLE(3,3,2,2))); ++#endif + } + + // Loads 2 floats from memory a returns the packet {a0, a0 a0, a0, a1, a1, a1, a1} +@@ -662,7 +682,7 @@ template<> EIGEN_STRONG_INLINE Packet8f ploadquad(const float* from) + } + template<> EIGEN_STRONG_INLINE Packet8i ploadquad(const int* from) + { +- return _mm256_inserti128_si256(_mm256_set1_epi32(*from), _mm_set1_epi32(*(from+1)), 1); ++ return _mm256_insertf128_si256(_mm256_set1_epi32(*from), _mm_set1_epi32(*(from+1)), 1); + } + + template<> EIGEN_STRONG_INLINE void pstore(float* to, const Packet8f& from) { EIGEN_DEBUG_ALIGNED_STORE _mm256_store_ps(to, from); } +@@ -723,13 +743,13 @@ template<> EIGEN_DEVICE_FUNC inline void pscatter(double* to, + } + template<> EIGEN_DEVICE_FUNC inline void pscatter(int* to, const Packet8i& from, Index stride) + { +- __m128i low = _mm256_extracti128_si256(from, 0); ++ __m128i low = _mm256_extractf128_si256(from, 0); + to[stride*0] = _mm_extract_epi32(low, 0); + to[stride*1] = _mm_extract_epi32(low, 1); + to[stride*2] = _mm_extract_epi32(low, 2); + to[stride*3] = _mm_extract_epi32(low, 3); + +- __m128i high = _mm256_extracti128_si256(from, 1); ++ __m128i high = _mm256_extractf128_si256(from, 1); + to[stride*4] = _mm_extract_epi32(high, 0); + to[stride*5] = _mm_extract_epi32(high, 1); + to[stride*6] = _mm_extract_epi32(high, 2); +@@ -803,7 +823,13 @@ template<> EIGEN_STRONG_INLINE Packet4d pabs(const Packet4d& a) + } + template<> EIGEN_STRONG_INLINE Packet8i pabs(const Packet8i& a) + { ++#ifdef EIGEN_VECTORIZE_AVX2 + return _mm256_abs_epi32(a); ++#else ++ __m128i lo = _mm_abs_epi32(_mm256_extractf128_si256(a, 0)); ++ __m128i hi = _mm_abs_epi32(_mm256_extractf128_si256(a, 1)); ++ return _mm256_insertf128_si256(_mm256_castsi128_si256(lo), (hi), 1); ++#endif + } + + template<> EIGEN_STRONG_INLINE Packet8f pfrexp(const Packet8f& a, Packet8f& exponent) { +@@ -989,16 +1015,27 @@ ptranspose(PacketBlock& kernel) { + #define MM256_SHUFFLE_EPI32(A, B, M) \ + _mm256_castps_si256(_mm256_shuffle_ps(_mm256_castsi256_ps(A), _mm256_castsi256_ps(B), M)) + ++#ifdef EIGEN_VECTORIZE_AVX2 ++#define MM256_UNPACKLO_EPI32(A, B) \ ++ _mm256_castps_si256(_mm256_unpacklo_ps(_mm256_castsi256_ps(A), _mm256_castsi256_ps(B))) ++#define MM256_UNPACKHI_EPI32(A, B) \ ++ _mm256_castps_si256(_mm256_unpackhi_ps(_mm256_castsi256_ps(A), _mm256_castsi256_ps(B))) ++#else ++#define MM256_UNPACKLO_EPI32(A, B) _mm256_unpacklo_ps(A, B) ++#define MM256_UNPACKHI_EPI32(A, B) _mm256_unpackhi_ps(A, B) ++#endif ++ ++ + EIGEN_DEVICE_FUNC inline void + ptranspose(PacketBlock& kernel) { +- __m256i T0 = _mm256_unpacklo_epi32(kernel.packet[0], kernel.packet[1]); +- __m256i T1 = _mm256_unpackhi_epi32(kernel.packet[0], kernel.packet[1]); +- __m256i T2 = _mm256_unpacklo_epi32(kernel.packet[2], kernel.packet[3]); +- __m256i T3 = _mm256_unpackhi_epi32(kernel.packet[2], kernel.packet[3]); +- __m256i T4 = _mm256_unpacklo_epi32(kernel.packet[4], kernel.packet[5]); +- __m256i T5 = _mm256_unpackhi_epi32(kernel.packet[4], kernel.packet[5]); +- __m256i T6 = _mm256_unpacklo_epi32(kernel.packet[6], kernel.packet[7]); +- __m256i T7 = _mm256_unpackhi_epi32(kernel.packet[6], kernel.packet[7]); ++ __m256i T0 = MM256_UNPACKLO_EPI32(kernel.packet[0], kernel.packet[1]); ++ __m256i T1 = MM256_UNPACKHI_EPI32(kernel.packet[0], kernel.packet[1]); ++ __m256i T2 = MM256_UNPACKLO_EPI32(kernel.packet[2], kernel.packet[3]); ++ __m256i T3 = MM256_UNPACKHI_EPI32(kernel.packet[2], kernel.packet[3]); ++ __m256i T4 = MM256_UNPACKLO_EPI32(kernel.packet[4], kernel.packet[5]); ++ __m256i T5 = MM256_UNPACKHI_EPI32(kernel.packet[4], kernel.packet[5]); ++ __m256i T6 = MM256_UNPACKLO_EPI32(kernel.packet[6], kernel.packet[7]); ++ __m256i T7 = MM256_UNPACKHI_EPI32(kernel.packet[6], kernel.packet[7]); + __m256i S0 = MM256_SHUFFLE_EPI32(T0,T2,_MM_SHUFFLE(1,0,1,0)); + __m256i S1 = MM256_SHUFFLE_EPI32(T0,T2,_MM_SHUFFLE(3,2,3,2)); + __m256i S2 = MM256_SHUFFLE_EPI32(T1,T3,_MM_SHUFFLE(1,0,1,0)); +@@ -1019,10 +1056,10 @@ ptranspose(PacketBlock& kernel) { + + EIGEN_DEVICE_FUNC inline void + ptranspose(PacketBlock& kernel) { +- __m256i T0 = _mm256_unpacklo_epi32(kernel.packet[0], kernel.packet[1]); +- __m256i T1 = _mm256_unpackhi_epi32(kernel.packet[0], kernel.packet[1]); +- __m256i T2 = _mm256_unpacklo_epi32(kernel.packet[2], kernel.packet[3]); +- __m256i T3 = _mm256_unpackhi_epi32(kernel.packet[2], kernel.packet[3]); ++ __m256i T0 = MM256_UNPACKLO_EPI32(kernel.packet[0], kernel.packet[1]); ++ __m256i T1 = MM256_UNPACKHI_EPI32(kernel.packet[0], kernel.packet[1]); ++ __m256i T2 = MM256_UNPACKLO_EPI32(kernel.packet[2], kernel.packet[3]); ++ __m256i T3 = MM256_UNPACKHI_EPI32(kernel.packet[2], kernel.packet[3]); + + __m256i S0 = MM256_SHUFFLE_EPI32(T0,T2,_MM_SHUFFLE(1,0,1,0)); + __m256i S1 = MM256_SHUFFLE_EPI32(T0,T2,_MM_SHUFFLE(3,2,3,2)); +diff --git a/third_party/eigen3/src/Eigen/src/Core/arch/AVX512/PacketMath.h b/third_party/eigen3/src/Eigen/src/Core/arch/AVX512/PacketMath.h +index 6ce15c677..0810f66ee 100644 +--- a/third_party/eigen3/src/Eigen/src/Core/arch/AVX512/PacketMath.h ++++ b/third_party/eigen3/src/Eigen/src/Core/arch/AVX512/PacketMath.h +@@ -1028,7 +1028,7 @@ template<> EIGEN_STRONG_INLINE Packet8d pldexp(const Packet8d& a, cons + + // AVX512F does not define _mm512_extracti32x8_epi32 to extract _m256i from _m512i + #define EIGEN_EXTRACT_8i_FROM_16i(INPUT, OUTPUT) \ +- __m256i OUTPUT##_0 = _mm512_extracti32x8_epi32(INPUT, 0) \ ++ __m256i OUTPUT##_0 = _mm512_extracti32x8_epi32(INPUT, 0); \ + __m256i OUTPUT##_1 = _mm512_extracti32x8_epi32(INPUT, 1) + #else + #define EIGEN_EXTRACT_8f_FROM_16f(INPUT, OUTPUT) \ +@@ -1037,7 +1037,7 @@ template<> EIGEN_STRONG_INLINE Packet8d pldexp(const Packet8d& a, cons + _mm512_extractf32x4_ps(INPUT, 1), 1); \ + __m256 OUTPUT##_1 = _mm256_insertf128_ps( \ + _mm256_castps128_ps256(_mm512_extractf32x4_ps(INPUT, 2)), \ +- _mm512_extractf32x4_ps(INPUT, 3), 1); ++ _mm512_extractf32x4_ps(INPUT, 3), 1) + + #define EIGEN_EXTRACT_8i_FROM_16i(INPUT, OUTPUT) \ + __m256i OUTPUT##_0 = _mm256_insertf128_si256( \ +@@ -1045,7 +1045,7 @@ template<> EIGEN_STRONG_INLINE Packet8d pldexp(const Packet8d& a, cons + _mm512_extracti32x4_epi32(INPUT, 1), 1); \ + __m256i OUTPUT##_1 = _mm256_insertf128_si256( \ + _mm256_castsi128_si256(_mm512_extracti32x4_epi32(INPUT, 2)), \ +- _mm512_extracti32x4_epi32(INPUT, 3), 1); ++ _mm512_extracti32x4_epi32(INPUT, 3), 1) + #endif + + #ifdef EIGEN_VECTORIZE_AVX512DQ +-- +GitLab + diff --git a/chromium-95-eigen-avx-2.patch b/chromium-95-eigen-avx-2.patch new file mode 100644 index 0000000..1cb8007 --- /dev/null +++ b/chromium-95-eigen-avx-2.patch @@ -0,0 +1,30 @@ +From def145547fc6abd14236e103b9443a36064f664f Mon Sep 17 00:00:00 2001 +From: Antonio Sanchez +Date: Thu, 2 Sep 2021 16:21:07 -0700 +Subject: [PATCH] Add missing packet types in pset1 call. + +Oops, introduced this when "fixing" integer packets. +--- + Eigen/src/Core/arch/AVX/PacketMath.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/third_party/eigen3/src/Eigen/src/Core/arch/AVX/PacketMath.h b/third_party/eigen3/src/Eigen/src/Core/arch/AVX/PacketMath.h +index 247ee4efd..8da9031dc 100644 +--- a/third_party/eigen3/src/Eigen/src/Core/arch/AVX/PacketMath.h ++++ b/third_party/eigen3/src/Eigen/src/Core/arch/AVX/PacketMath.h +@@ -274,9 +274,9 @@ template<> EIGEN_STRONG_INLINE Packet8i padd(const Packet8i& a, const + #endif + } + +-template<> EIGEN_STRONG_INLINE Packet8f plset(const float& a) { return padd(pset1(a), _mm256_set_ps(7.0,6.0,5.0,4.0,3.0,2.0,1.0,0.0)); } +-template<> EIGEN_STRONG_INLINE Packet4d plset(const double& a) { return padd(pset1(a), _mm256_set_pd(3.0,2.0,1.0,0.0)); } +-template<> EIGEN_STRONG_INLINE Packet8i plset(const int& a) { return padd(pset1(a), _mm256_set_epi32(7,6,5,4,3,2,1,0)); } ++template<> EIGEN_STRONG_INLINE Packet8f plset(const float& a) { return padd(pset1(a), _mm256_set_ps(7.0,6.0,5.0,4.0,3.0,2.0,1.0,0.0)); } ++template<> EIGEN_STRONG_INLINE Packet4d plset(const double& a) { return padd(pset1(a), _mm256_set_pd(3.0,2.0,1.0,0.0)); } ++template<> EIGEN_STRONG_INLINE Packet8i plset(const int& a) { return padd(pset1(a), _mm256_set_epi32(7,6,5,4,3,2,1,0)); } + + template<> EIGEN_STRONG_INLINE Packet8f psub(const Packet8f& a, const Packet8f& b) { return _mm256_sub_ps(a,b); } + template<> EIGEN_STRONG_INLINE Packet4d psub(const Packet4d& a, const Packet4d& b) { return _mm256_sub_pd(a,b); } +-- +GitLab + diff --git a/chromium-95-eigen-avx-3.patch b/chromium-95-eigen-avx-3.patch new file mode 100644 index 0000000..44e9ef4 --- /dev/null +++ b/chromium-95-eigen-avx-3.patch @@ -0,0 +1,44 @@ +From 7792b1e909a98703181aecb8810b4b654004c25d Mon Sep 17 00:00:00 2001 +From: Antonio Sanchez +Date: Fri, 3 Sep 2021 10:41:35 -0700 +Subject: [PATCH] Fix AVX2 PacketMath.h. + +There were a couple typos ps -> epi32, and an unaligned load issue. +--- + Eigen/src/Core/arch/AVX/PacketMath.h | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/third_party/eigen3/src/Eigen/src/Core/arch/AVX/PacketMath.h b/third_party/eigen3/src/Eigen/src/Core/arch/AVX/PacketMath.h +index 8da9031dc..41cb7af9c 100644 +--- a/third_party/eigen3/src/Eigen/src/Core/arch/AVX/PacketMath.h ++++ b/third_party/eigen3/src/Eigen/src/Core/arch/AVX/PacketMath.h +@@ -663,7 +663,7 @@ template<> EIGEN_STRONG_INLINE Packet4d ploaddup(const double* from) + template<> EIGEN_STRONG_INLINE Packet8i ploaddup(const int* from) + { + #ifdef EIGEN_VECTORIZE_AVX2 +- const Packet8i a = _mm256_castsi128_si256(pload(from)); ++ const Packet8i a = _mm256_castsi128_si256(ploadu(from)); + return _mm256_permutevar8x32_epi32(a, _mm256_setr_epi32(0, 0, 1, 1, 2, 2, 3, 3)); + #else + __m256 tmp = _mm256_broadcast_ps((const __m128*)(const void*)from); +@@ -1015,14 +1015,14 @@ ptranspose(PacketBlock& kernel) { + #define MM256_SHUFFLE_EPI32(A, B, M) \ + _mm256_castps_si256(_mm256_shuffle_ps(_mm256_castsi256_ps(A), _mm256_castsi256_ps(B), M)) + +-#ifdef EIGEN_VECTORIZE_AVX2 ++#ifndef EIGEN_VECTORIZE_AVX2 + #define MM256_UNPACKLO_EPI32(A, B) \ + _mm256_castps_si256(_mm256_unpacklo_ps(_mm256_castsi256_ps(A), _mm256_castsi256_ps(B))) + #define MM256_UNPACKHI_EPI32(A, B) \ + _mm256_castps_si256(_mm256_unpackhi_ps(_mm256_castsi256_ps(A), _mm256_castsi256_ps(B))) + #else +-#define MM256_UNPACKLO_EPI32(A, B) _mm256_unpacklo_ps(A, B) +-#define MM256_UNPACKHI_EPI32(A, B) _mm256_unpackhi_ps(A, B) ++#define MM256_UNPACKLO_EPI32(A, B) _mm256_unpacklo_epi32(A, B) ++#define MM256_UNPACKHI_EPI32(A, B) _mm256_unpackhi_epi32(A, B) + #endif + + +-- +GitLab + diff --git a/chromium-95-libyuv-aarch64.patch b/chromium-95-libyuv-aarch64.patch new file mode 100644 index 0000000..b214356 --- /dev/null +++ b/chromium-95-libyuv-aarch64.patch @@ -0,0 +1,30 @@ +diff --git a/third_party/libyuv/source/row_neon64.cc b/third_party/libyuv/source/row_neon64.cc +index 350c964..2aab413 100644 +--- a/third_party/libyuv/source/row_neon64.cc ++++ b/third_party/libyuv/source/row_neon64.cc +@@ -1835,7 +1835,7 @@ void ARGBToAB64Row_NEON(const uint8_t* src_argb, + : "+r"(src_argb), // %0 + "+r"(dst_ab64), // %1 + "+r"(width) // %2 +- : "m"(kShuffleARGBToABGR) // %3 ++ : "Q"(kShuffleARGBToABGR) // %3 + : "cc", "memory", "v0", "v1", "v2", "v3", "v4"); + } + +@@ -1859,7 +1859,7 @@ void AR64ToARGBRow_NEON(const uint16_t* src_ar64, + : "+r"(src_ar64), // %0 + "+r"(dst_argb), // %1 + "+r"(width) // %2 +- : "m"(kShuffleAR64ToARGB) // %3 ++ : "Q"(kShuffleAR64ToARGB) // %3 + : "cc", "memory", "v0", "v1", "v2", "v3", "v4"); + } + +@@ -1883,7 +1883,7 @@ void AB64ToARGBRow_NEON(const uint16_t* src_ab64, + : "+r"(src_ab64), // %0 + "+r"(dst_argb), // %1 + "+r"(width) // %2 +- : "m"(kShuffleAB64ToARGB) // %3 ++ : "Q"(kShuffleAB64ToARGB) // %3 + : "cc", "memory", "v0", "v1", "v2", "v3", "v4"); + } diff --git a/chromium-95-maldoca-zlib.patch b/chromium-95-maldoca-zlib.patch new file mode 100644 index 0000000..1f64a66 --- /dev/null +++ b/chromium-95-maldoca-zlib.patch @@ -0,0 +1,13 @@ +diff --git a/third_party/maldoca/BUILD.gn b/third_party/maldoca/BUILD.gn +index eeab205..29a0a2c 100644 +--- a/third_party/maldoca/BUILD.gn ++++ b/third_party/maldoca/BUILD.gn +@@ -224,7 +224,7 @@ source_set("maldoca-ole") { + "//third_party/libxml", + "//third_party/protobuf:protobuf_lite", + "//third_party/re2", +- "//third_party/zlib:zlib_common_headers", ++ "//third_party/zlib:zlib", + "//third_party/zlib/google:zip", + ] + diff --git a/chromium-95-quiche-include.patch b/chromium-95-quiche-include.patch new file mode 100644 index 0000000..4bbd45c --- /dev/null +++ b/chromium-95-quiche-include.patch @@ -0,0 +1,25 @@ +From a9d986203bcfbaab84f270c1dc6c3abb4c450ee1 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Fri, 17 Sep 2021 14:57:33 +0000 +Subject: [PATCH] IWYU: add stddef.h for size_t in WindowManager + +--- + net/third_party/quiche/src/http2/adapter/window_manager.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/net/third_party/quiche/src/http2/adapter/window_manager.h b/net/third_party/quiche/src/http2/adapter/window_manager.h +index f15982d..5a7701e 100644 +--- a/net/third_party/quiche/src/http2/adapter/window_manager.h ++++ b/net/third_party/quiche/src/http2/adapter/window_manager.h +@@ -1,6 +1,8 @@ + #ifndef QUICHE_HTTP2_ADAPTER_WINDOW_MANAGER_H_ + #define QUICHE_HTTP2_ADAPTER_WINDOW_MANAGER_H_ + ++#include ++ + #include + + #include "common/platform/api/quiche_export.h" +-- +2.32.0 + diff --git a/chromium-95-xfce-maximize.patch b/chromium-95-xfce-maximize.patch new file mode 100644 index 0000000..296d978 --- /dev/null +++ b/chromium-95-xfce-maximize.patch @@ -0,0 +1,30 @@ +From 603d765ca5154db27718d89a2ee9be2a95a64254 Mon Sep 17 00:00:00 2001 +From: Alexander Dunaev +Date: Fri, 29 Oct 2021 20:54:46 +0700 +Subject: [PATCH] [linux/xfce] Set zero insets on maximising the window. + +It turned out that Xfwm handles the frame insets not the way KWin and +Mutter do. + +Bug: 1260821 +Change-Id: I69e71049157c03b74d78bc5edb7a60bf39cdda8b +--- + +diff --git a/ui/platform_window/x11/x11_window.cc b/ui/platform_window/x11/x11_window.cc +index dd381747..706f19c 100644 +--- a/ui/platform_window/x11/x11_window.cc ++++ b/ui/platform_window/x11/x11_window.cc +@@ -676,6 +676,13 @@ + // save this one for later too. + should_maximize_after_map_ = !window_mapped_in_client_; + ++ // Some WMs keep respecting the frame extents even if the window is maximised. ++ // Remove the insets when maximising. The extents will be set again when the ++ // window is restored to normal state. ++ // See https://crbug.com/1260821 ++ if (CanSetDecorationInsets()) ++ SetDecorationInsets(nullptr); ++ + SetWMSpecState(true, x11::GetAtom("_NET_WM_STATE_MAXIMIZED_VERT"), + x11::GetAtom("_NET_WM_STATE_MAXIMIZED_HORZ")); + } diff --git a/chromium-95.0.4638.69-missing-cstring.patch b/chromium-95.0.4638.69-missing-cstring.patch new file mode 100644 index 0000000..bb0747f --- /dev/null +++ b/chromium-95.0.4638.69-missing-cstring.patch @@ -0,0 +1,57 @@ +diff -up chromium-95.0.4638.69/net/base/test_data_stream.cc.missing-cstring chromium-95.0.4638.69/net/base/test_data_stream.cc +--- chromium-95.0.4638.69/net/base/test_data_stream.cc.missing-cstring 2021-11-14 16:04:59.911270740 +0000 ++++ chromium-95.0.4638.69/net/base/test_data_stream.cc 2021-11-14 16:04:59.881272143 +0000 +@@ -5,6 +5,7 @@ + #include "net/base/test_data_stream.h" + + #include ++#include + + namespace net { + +diff -up chromium-95.0.4638.69/net/filter/filter_source_stream_test_util.cc.missing-cstring chromium-95.0.4638.69/net/filter/filter_source_stream_test_util.cc +--- chromium-95.0.4638.69/net/filter/filter_source_stream_test_util.cc.missing-cstring 2021-11-15 15:54:35.895963882 +0000 ++++ chromium-95.0.4638.69/net/filter/filter_source_stream_test_util.cc 2021-11-15 15:54:50.342288149 +0000 +@@ -4,6 +4,8 @@ + + #include "net/filter/filter_source_stream_test_util.h" + ++#include ++ + #include "base/bit_cast.h" + #include "base/check_op.h" + #include "third_party/zlib/zlib.h" +diff -up chromium-95.0.4638.69/third_party/webrtc/audio/utility/channel_mixer.cc.missing-cstring chromium-95.0.4638.69/third_party/webrtc/audio/utility/channel_mixer.cc +--- chromium-95.0.4638.69/third_party/webrtc/audio/utility/channel_mixer.cc.missing-cstring 2021-11-14 16:05:24.613116022 +0000 ++++ chromium-95.0.4638.69/third_party/webrtc/audio/utility/channel_mixer.cc 2021-11-14 16:05:24.614115975 +0000 +@@ -8,6 +8,8 @@ + * be found in the AUTHORS file in the root of the source tree. + */ + ++#include ++ + #include "audio/utility/channel_mixer.h" + + #include "audio/utility/channel_mixing_matrix.h" +diff -up chromium-95.0.4638.69/third_party/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc.missing-cstring chromium-95.0.4638.69/third_party/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc +--- chromium-95.0.4638.69/third_party/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc.missing-cstring 2021-11-14 16:05:24.095140235 +0000 ++++ chromium-95.0.4638.69/third_party/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc 2021-11-14 16:05:24.095140235 +0000 +@@ -19,6 +19,7 @@ + #include + #include + ++#include + #include + #include + +diff -up chromium-95.0.4638.69/third_party/webrtc/modules/video_coding/utility/ivf_file_reader.cc.missing-cstring chromium-95.0.4638.69/third_party/webrtc/modules/video_coding/utility/ivf_file_reader.cc +--- chromium-95.0.4638.69/third_party/webrtc/modules/video_coding/utility/ivf_file_reader.cc.missing-cstring 2021-11-14 16:05:23.794154305 +0000 ++++ chromium-95.0.4638.69/third_party/webrtc/modules/video_coding/utility/ivf_file_reader.cc 2021-11-14 16:05:23.792154399 +0000 +@@ -10,6 +10,7 @@ + + #include "modules/video_coding/utility/ivf_file_reader.h" + ++#include + #include + #include + diff --git a/chromium-95.0.4638.69-norar.patch b/chromium-95.0.4638.69-norar.patch new file mode 100644 index 0000000..ee8c255 --- /dev/null +++ b/chromium-95.0.4638.69-norar.patch @@ -0,0 +1,90 @@ +diff -up chromium-95.0.4638.69/chrome/common/safe_browsing/BUILD.gn.nounrar chromium-95.0.4638.69/chrome/common/safe_browsing/BUILD.gn +--- chromium-95.0.4638.69/chrome/common/safe_browsing/BUILD.gn.nounrar 2021-10-28 23:07:12.000000000 -0400 ++++ chromium-95.0.4638.69/chrome/common/safe_browsing/BUILD.gn 2021-11-12 11:33:52.691346496 -0500 +@@ -58,39 +58,6 @@ if (safe_browsing_mode == 1) { + public_deps = [ "//components/safe_browsing/core/common/proto:csd_proto" ] + } + +- source_set("rar_analyzer") { +- sources = [ +- "rar_analyzer.cc", +- "rar_analyzer.h", +- ] +- +- deps = [ +- ":archive_analyzer_results", +- ":download_type_util", +- "//base", +- "//base:i18n", +- "//components/safe_browsing/content/common:file_type_policies", +- "//components/safe_browsing/core/common", +- "//third_party/unrar:unrar", +- ] +- +- defines = [ +- "_FILE_OFFSET_BITS=64", +- "LARGEFILE_SOURCE", +- "RAR_SMP", +- "SILENT", +- +- # The following is set to disable certain macro definitions in the unrar +- # source code. +- "CHROMIUM_UNRAR", +- +- # Disables exceptions in unrar, replaces them with process termination. +- "UNRAR_NO_EXCEPTIONS", +- ] +- +- public_deps = [ "//components/safe_browsing/core/common/proto:csd_proto" ] +- } +- + if (is_linux || is_win) { + source_set("document_analyzer") { + sources = [ +@@ -189,7 +156,6 @@ source_set("safe_browsing") { + ":archive_analyzer_results", + ":binary_feature_extractor", + ":download_type_util", +- ":rar_analyzer", + "//components/safe_browsing/core/common", + ] + +diff -up chromium-95.0.4638.69/chrome/common/safe_browsing/DEPS.nounrar chromium-95.0.4638.69/chrome/common/safe_browsing/DEPS +--- chromium-95.0.4638.69/chrome/common/safe_browsing/DEPS.nounrar 2021-11-12 11:30:02.629954310 -0500 ++++ chromium-95.0.4638.69/chrome/common/safe_browsing/DEPS 2021-11-12 11:34:16.732491978 -0500 +@@ -3,6 +3,5 @@ include_rules = [ + "+components/safe_browsing/core/common", + "+third_party/maldoca", + "+third_party/protobuf", +- "+third_party/unrar", + "+third_party/zlib", + ] +diff -up chromium-95.0.4638.69/chrome/services/file_util/BUILD.gn.nounrar chromium-95.0.4638.69/chrome/services/file_util/BUILD.gn +--- chromium-95.0.4638.69/chrome/services/file_util/BUILD.gn.nounrar 2021-11-12 11:30:02.629954310 -0500 ++++ chromium-95.0.4638.69/chrome/services/file_util/BUILD.gn 2021-11-12 11:36:08.277168386 -0500 +@@ -60,7 +60,6 @@ source_set("file_util") { + deps += [ + "//chrome/common/safe_browsing", + "//chrome/common/safe_browsing:archive_analyzer_results", +- "//chrome/common/safe_browsing:rar_analyzer", + ] + + if (is_linux || is_win) { +diff -up chromium-95.0.4638.69/chrome/services/file_util/safe_archive_analyzer.cc.nounrar chromium-95.0.4638.69/chrome/services/file_util/safe_archive_analyzer.cc +--- chromium-95.0.4638.69/chrome/services/file_util/safe_archive_analyzer.cc.nounrar 2021-10-28 23:07:12.000000000 -0400 ++++ chromium-95.0.4638.69/chrome/services/file_util/safe_archive_analyzer.cc 2021-11-12 11:30:02.630954316 -0500 +@@ -45,10 +45,14 @@ void SafeArchiveAnalyzer::AnalyzeDmgFile + void SafeArchiveAnalyzer::AnalyzeRarFile(base::File rar_file, + base::File temporary_file, + AnalyzeRarFileCallback callback) { ++#if 0 + DCHECK(rar_file.IsValid()); + + safe_browsing::ArchiveAnalyzerResults results; + safe_browsing::rar_analyzer::AnalyzeRarFile( + std::move(rar_file), std::move(temporary_file), &results); + std::move(callback).Run(results); ++#else ++ NOTREACHED(); ++#endif + } diff --git a/chromium.spec b/chromium.spec index 900fc91..e44cf98 100644 --- a/chromium.spec +++ b/chromium.spec @@ -217,14 +217,14 @@ BuildRequires: libicu-devel >= 5.4 %global chromoting_client_id %nil %endif -%global majorversion 94 +%global majorversion 95 %if %{freeworld} Name: chromium%{chromium_channel}%{nsuffix} %else Name: chromium%{chromium_channel} %endif -Version: %{majorversion}.0.4606.81 +Version: %{majorversion}.0.4638.69 Release: 1%{?dist} %if %{?freeworld} %if %{?shared} @@ -253,7 +253,7 @@ Patch4: chromium-60.0.3112.78-jpeg-nomangle.patch # Do not mangle zlib Patch5: chromium-77.0.3865.75-no-zlib-mangle.patch # Do not use unrar code, it is non-free -Patch6: chromium-93.0.4577.63-norar.patch +Patch6: chromium-95.0.4638.69-norar.patch # Use Gentoo's Widevine hack # https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/files/chromium-widevine-r3.patch Patch7: chromium-71.0.3578.98-widevine-r3.patch @@ -272,25 +272,38 @@ Patch11: chromium-92.0.4515.107-py2-bootstrap.patch # Add "Fedora" to the user agent string Patch12: chromium-86.0.4240.75-fedora-user-agent.patch +# https://gitweb.gentoo.org/repo/gentoo.git/plain/www-client/chromium/files/chromium-95-maldoca-zlib.patch +Patch20: chromium-95-maldoca-zlib.patch + +# https://gitweb.gentoo.org/repo/gentoo.git/plain/www-client/chromium/files/chromium-95-eigen-avx-1.patch +# https://gitweb.gentoo.org/repo/gentoo.git/plain/www-client/chromium/files/chromium-95-eigen-avx-2.patch +# https://gitweb.gentoo.org/repo/gentoo.git/plain/www-client/chromium/files/chromium-95-eigen-avx-3.patch +Patch21: chromium-95-eigen-avx-1.patch +Patch22: chromium-95-eigen-avx-2.patch +Patch23: chromium-95-eigen-avx-3.patch + +# https://gitweb.gentoo.org/repo/gentoo.git/plain/www-client/chromium/files/chromium-95-xfce-maximize.patch +Patch24: chromium-95-xfce-maximize.patch + # Needs to be submitted.. Patch51: chromium-76.0.3809.100-gcc-remoting-constexpr.patch # https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/files/chromium-unbundle-zlib.patch Patch52: chromium-81.0.4044.92-unbundle-zlib.patch -# Needs to be submitted.. -Patch53: chromium-77.0.3865.75-gcc-include-memory.patch # https://github.com/stha09/chromium-patches/blob/master/chromium-78-protobuf-RepeatedPtrField-export.patch Patch55: chromium-78-protobuf-RepeatedPtrField-export.patch # ../../third_party/perfetto/include/perfetto/base/task_runner.h:48:55: error: 'uint32_t' has not been declared Patch56: chromium-80.0.3987.87-missing-cstdint-header.patch # Missing (thanks c++17) -Patch57: chromium-93.0.4577.63-missing-cstring.patch +Patch57: chromium-95.0.4638.69-missing-cstring.patch # prepare for using system ffmpeg (clean) # http://svnweb.mageia.org/packages/cauldron/chromium-browser-stable/current/SOURCES/chromium-53-ffmpeg-no-deprecation-errors.patch?view=markup Patch58: chromium-53-ffmpeg-no-deprecation-errors.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-91-libyuv-aarch64.patch -Patch60: chromium-91-libyuv-aarch64.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-90-ruy-include.patch -Patch62: chromium-90-ruy-include.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-95-libyuv-aarch64.patch +Patch60: chromium-95-libyuv-aarch64.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-95-quiche-include.patch +Patch61: chromium-95-quiche-include.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-95-BitstreamReader-namespace.patch +Patch62: chromium-95-BitstreamReader-namespace.patch # Extra CXXFLAGS for aarch64 Patch63: chromium-91.0.4472.77-aarch64-cxxflags-addition.patch # Fix issue where closure_compiler thinks java is only allowed in android builds @@ -309,13 +322,10 @@ Patch68: chromium-84.0.4147.125-aarch64-clearkeycdm-binutils-workaround.patch Patch76: chromium-92.0.4515.107-rawhide-gcc-std-max-fix.patch # Do not download proprietary widevine module in the background (thanks Debian) Patch79: chromium-93.0.4577.63-widevine-no-download.patch + # Fix crashes with components/cast_* # Thanks to Gentoo Patch80: chromium-92.0.4515.107-EnumTable-crash.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-94-ConversionStorageSql-lambda.patch -Patch81: chromium-94-ConversionStorageSql-lambda.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-94-CustomSpaces-include.patch -Patch82: chromium-94-CustomSpaces-include.patch # Fixes for python3 Patch83: chromium-92.0.4515.107-py3-fixes.patch # Add missing cmath header @@ -997,17 +1007,23 @@ udev. %endif # Short term fixes (usually gcc and backports) +%patch20 -p1 -b .maldoca-zlib +%patch21 -p1 -b .eigen-avx-1 +%patch22 -p1 -b .eigen-avx-2 +%patch23 -p1 -b .eigen-avx-3 +%patch24 -p1 -b .xfce-maximize + %patch51 -p1 -b .gcc-remoting-constexpr %if 0%{?fedora} || 0%{?rhel} >= 8 %patch52 -p1 -b .unbundle-zlib %endif -%patch53 -p1 -b .gcc-include-memory %patch55 -p1 -b .protobuf-export %patch56 -p1 -b .missing-cstdint %patch57 -p1 -b .missing-cstring %patch58 -p1 -b .ffmpeg-deprecations %patch60 -p1 -b .libyuv-aarch64 -%patch62 -p1 -b .ruy-include +%patch61 -p1 -b .quiche-include +%patch62 -p1 -b .BitstreamReader-namespace %patch63 -p1 -b .aarch64-cxxflags-addition %patch64 -p1 -b .java-only-allowed %patch65 -p1 -b .gn-gcc-cleanup @@ -1019,8 +1035,6 @@ udev. %endif %patch79 -p1 -b .widevine-no-download %patch80 -p1 -b .EnumTable-crash -%patch81 -p1 -b .ConversionStorageSql-lambda-include -%patch82 -p1 -b .CustomSpaces-include %patch83 -p1 -b .py3fixes %patch84 -p1 -b .remoting-missing-cmath-header %patch86 -p1 -b .clang-format-py3 @@ -1338,6 +1352,7 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/devtools-frontend/src/front_end/third_party/puppeteer' \ 'third_party/devtools-frontend/src/front_end/third_party/wasmparser' \ 'third_party/devtools-frontend/src/test/unittests/front_end/third_party/i18n' \ + 'third_party/devtools-frontend/src/third_party' \ 'third_party/dom_distiller_js' \ 'third_party/eigen3' \ 'third_party/emoji-segmenter' \ @@ -1406,6 +1421,9 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/lss' \ 'third_party/lzma_sdk' \ 'third_party/mako' \ + 'third_party/maldoca' \ + 'third_party/maldoca/src/third_party/tensorflow_protos' \ + 'third_party/maldoca/src/third_party/zlibwrapper' \ 'third_party/markupsafe' \ 'third_party/mesa' \ 'third_party/metrics_proto' \ @@ -2126,6 +2144,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Fri Nov 12 2021 Tom Callaway - 95.0.4638.69-1 +- update to 95.0.4638.69 + * Fri Oct 8 2021 Tom Callaway - 94.0.4606.81-1 - update to 94.0.4606.81 diff --git a/sources b/sources index 152d62b..36e32cf 100644 --- a/sources +++ b/sources @@ -21,4 +21,4 @@ SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1d SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a SHA512 (node-v12.22.6-linux-arm64.tar.xz) = 87ce5eb954deb1d0debe6fa02b28a3cc675e12fca1e51d44b123ab294aa39ce0c6b8ac9eae1e7a6e32673ea2c2d480651d9ba7eea73012f0529503eebe9eb34d SHA512 (node-v12.22.6-linux-x64.tar.xz) = e1b55c32343cb2ccc40d888c705414bebf9c46b02083d13731df79b1e79521b7277761f6bcca041e40e3a2e47c67bb8e7848aa2b919a9de5c2ebf62c4a9c7176 -SHA512 (chromium-94.0.4606.81-clean.tar.xz) = 4cc14e91b244d59b30931e7ff90e6a031784d1da9f2e3e72172757d0a76305ccd265f5456779bfcb893482d70a5cc86b52a0d26e255331505d5c2acc036f87e9 +SHA512 (chromium-95.0.4638.69-clean.tar.xz) = b4e7c917300ead59492b0817a3a73f74cebdb6daa62d90edf5f7df8a4de2cdeb100d45811611b5251bd50dab363ec54090fa39cfa97c7a194bdd6bca6c5e4072 From 83cb808c80fd2f64ad1d6bc491a0c9aeb8a56ee6 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Tue, 16 Nov 2021 09:37:06 -0500 Subject: [PATCH 058/659] use bundled harfbuzz everywhere --- chromium.spec | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/chromium.spec b/chromium.spec index e44cf98..ffe724b 100644 --- a/chromium.spec +++ b/chromium.spec @@ -167,12 +167,8 @@ BuildRequires: libicu-devel >= 5.4 %global bundlelibdrm 1 %global bundlefontconfig 1 %else -# As of Chromium 94, it uses functions in harfbuzz 2.9.0+, which is only found in F36+. -%if 0%{?fedora} >= 36 -%global bundleharfbuzz 0 -%else +# Chromium really wants to use its bundled harfbuzz. Sigh. %global bundleharfbuzz 1 -%endif %global bundleopus 1 %global bundlelibusbx 0 %global bundlelibwebp 0 From a15ac604be302f43f039d73e6491c019e69dc5a1 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Wed, 24 Nov 2021 23:21:01 -0500 Subject: [PATCH 059/659] 96 --- chromium-96-CommandLine-include.patch | 24 +++++ chromium-96-CouponDB-include.patch | 25 +++++ ...m-96-DrmRenderNodePathFinder-include.patch | 24 +++++ chromium-96-EnumTable-crash.patch | 76 +++++++++++++ ...ium-96-RestrictedCookieManager-tuple.patch | 31 ++++++ chromium-96-xfce-maximize.patch | 51 +++++++++ ...-96.0.4664.45-gcc-remoting-constexpr.patch | 25 +++++ ...-96.0.4664.45-missing-cstdint-header.patch | 35 ++++++ chromium-96.0.4664.45-missing-cstring.patch | 47 ++++++++ ...4.45-no-const-elements-in-std-vector.patch | 17 +++ chromium.spec | 102 +++++++----------- clean_ffmpeg.sh | 1 + sources | 2 +- 13 files changed, 398 insertions(+), 62 deletions(-) create mode 100644 chromium-96-CommandLine-include.patch create mode 100644 chromium-96-CouponDB-include.patch create mode 100644 chromium-96-DrmRenderNodePathFinder-include.patch create mode 100644 chromium-96-EnumTable-crash.patch create mode 100644 chromium-96-RestrictedCookieManager-tuple.patch create mode 100644 chromium-96-xfce-maximize.patch create mode 100644 chromium-96.0.4664.45-gcc-remoting-constexpr.patch create mode 100644 chromium-96.0.4664.45-missing-cstdint-header.patch create mode 100644 chromium-96.0.4664.45-missing-cstring.patch create mode 100644 chromium-96.0.4664.45-no-const-elements-in-std-vector.patch diff --git a/chromium-96-CommandLine-include.patch b/chromium-96-CommandLine-include.patch new file mode 100644 index 0000000..2d7b7e9 --- /dev/null +++ b/chromium-96-CommandLine-include.patch @@ -0,0 +1,24 @@ +From 39e6e77798d86033e5eb1fb2a2caf20a5bca2262 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Sat, 9 Oct 2021 08:27:04 +0000 +Subject: [PATCH] IWYU: add memory for std::unique_ptr in base::CommandLine + +--- + base/command_line.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/base/command_line.h b/base/command_line.h +index 706726a..ad02812 100644 +--- a/base/command_line.h ++++ b/base/command_line.h +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + #include + #include + +-- +2.32.0 + diff --git a/chromium-96-CouponDB-include.patch b/chromium-96-CouponDB-include.patch new file mode 100644 index 0000000..41acfb3 --- /dev/null +++ b/chromium-96-CouponDB-include.patch @@ -0,0 +1,25 @@ +From 3a7b8dd0fcceffcfd0ea7e3186d2850deed7a00b Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Wed, 6 Oct 2021 15:36:47 +0000 +Subject: [PATCH] IWYU: add vector for std::vector in CouponDB + +--- + chrome/browser/commerce/coupons/coupon_db.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/chrome/browser/commerce/coupons/coupon_db.h b/chrome/browser/commerce/coupons/coupon_db.h +index f0758f4..93e2dd3 100644 +--- a/chrome/browser/commerce/coupons/coupon_db.h ++++ b/chrome/browser/commerce/coupons/coupon_db.h +@@ -5,6 +5,8 @@ + #ifndef CHROME_BROWSER_COMMERCE_COUPONS_COUPON_DB_H_ + #define CHROME_BROWSER_COMMERCE_COUPONS_COUPON_DB_H_ + ++#include ++ + #include "base/callback_helpers.h" + #include "base/memory/weak_ptr.h" + #include "url/gurl.h" +-- +2.32.0 + diff --git a/chromium-96-DrmRenderNodePathFinder-include.patch b/chromium-96-DrmRenderNodePathFinder-include.patch new file mode 100644 index 0000000..fd44eb2 --- /dev/null +++ b/chromium-96-DrmRenderNodePathFinder-include.patch @@ -0,0 +1,24 @@ +From 9e36b3c28935fb50d43ccef443be786a8e3f8a5f Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Sat, 9 Oct 2021 16:17:34 +0000 +Subject: [PATCH] IWYU: add string.h for memcmp in ui:: DrmRenderNodePathFinder + +--- + ui/ozone/platform/wayland/gpu/drm_render_node_path_finder.cc | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/ui/ozone/platform/wayland/gpu/drm_render_node_path_finder.cc b/ui/ozone/platform/wayland/gpu/drm_render_node_path_finder.cc +index 06776a7..d5b7b71 100644 +--- a/ui/ozone/platform/wayland/gpu/drm_render_node_path_finder.cc ++++ b/ui/ozone/platform/wayland/gpu/drm_render_node_path_finder.cc +@@ -5,6 +5,7 @@ + #include "ui/ozone/platform/wayland/gpu/drm_render_node_path_finder.h" + + #include ++#include + #include + #include + #include +-- +2.32.0 + diff --git a/chromium-96-EnumTable-crash.patch b/chromium-96-EnumTable-crash.patch new file mode 100644 index 0000000..9736739 --- /dev/null +++ b/chromium-96-EnumTable-crash.patch @@ -0,0 +1,76 @@ +diff --git a/components/cast_channel/enum_table.h b/components/cast_channel/enum_table.h +index aad9e08..2f3fcad 100644 +--- a/components/cast_channel/enum_table.h ++++ b/components/cast_channel/enum_table.h +@@ -8,6 +8,7 @@ + #include + #include + #include ++#include + + #include "base/check_op.h" + #include "base/macros.h" +@@ -188,7 +189,6 @@ class + inline constexpr GenericEnumTableEntry(int32_t value); + inline constexpr GenericEnumTableEntry(int32_t value, base::StringPiece str); + +- GenericEnumTableEntry(const GenericEnumTableEntry&) = delete; + GenericEnumTableEntry& operator=(const GenericEnumTableEntry&) = delete; + + private: +@@ -254,7 +254,6 @@ class EnumTable { + constexpr Entry(E value, base::StringPiece str) + : GenericEnumTableEntry(static_cast(value), str) {} + +- Entry(const Entry&) = delete; + Entry& operator=(const Entry&) = delete; + }; + +@@ -313,15 +312,14 @@ class EnumTable { + if (is_sorted_) { + const std::size_t index = static_cast(value); + if (ANALYZER_ASSUME_TRUE(index < data_.size())) { +- const auto& entry = data_.begin()[index]; ++ const auto& entry = data_[index]; + if (ANALYZER_ASSUME_TRUE(entry.has_str())) + return entry.str(); + } + return absl::nullopt; + } + return GenericEnumTableEntry::FindByValue( +- reinterpret_cast(data_.begin()), +- data_.size(), static_cast(value)); ++ &data_[0], data_.size(), static_cast(value)); + } + + // This overload of GetString is designed for cases where the argument is a +@@ -349,8 +347,7 @@ class EnumTable { + // enum value directly. + absl::optional GetEnum(base::StringPiece str) const { + auto* entry = GenericEnumTableEntry::FindByString( +- reinterpret_cast(data_.begin()), +- data_.size(), str); ++ &data_[0], data_.size(), str); + return entry ? static_cast(entry->value) : absl::optional(); + } + +@@ -365,7 +362,7 @@ class EnumTable { + // Align the data on a cache line boundary. + alignas(64) + #endif +- std::initializer_list data_; ++ const std::vector data_; + bool is_sorted_; + + constexpr EnumTable(std::initializer_list data, bool is_sorted) +@@ -377,8 +374,8 @@ class EnumTable { + + for (std::size_t i = 0; i < data.size(); i++) { + for (std::size_t j = i + 1; j < data.size(); j++) { +- const Entry& ei = data.begin()[i]; +- const Entry& ej = data.begin()[j]; ++ const Entry& ei = data[i]; ++ const Entry& ej = data[j]; + DCHECK(ei.value != ej.value) + << "Found duplicate enum values at indices " << i << " and " << j; + DCHECK(!(ei.has_str() && ej.has_str() && ei.str() == ej.str())) diff --git a/chromium-96-RestrictedCookieManager-tuple.patch b/chromium-96-RestrictedCookieManager-tuple.patch new file mode 100644 index 0000000..cbdca44 --- /dev/null +++ b/chromium-96-RestrictedCookieManager-tuple.patch @@ -0,0 +1,31 @@ +From 86b1886673c3e75d3a7b8c802b3e9fa6ea945a1e Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz +Date: Fri, 08 Oct 2021 06:32:55 +0000 +Subject: [PATCH] libstdc++: no implicit conversion from tuple created with std::tie to an std::pair in restricted cookie manager. + +Fix compilation error: + ../../services/network/restricted_cookie_manager.cc:164:30: error: no match for ‘operator[]’ (operand types are ‘network::CookieAccessesByURLAndSite’ {aka ‘std::map, std::unique_ptr > >’} and ‘std::tuple’) + +There is no conversion from tuple to pair. + +Bug: 957519 +Change-Id: Idf29c7b21895ae28f45b35d6193ab4ac555945c8 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3211752 +Reviewed-by: Robbie McElrath +Commit-Queue: José Dapena Paz +Cr-Commit-Position: refs/heads/main@{#929597} +--- + +diff --git a/services/network/restricted_cookie_manager.cc b/services/network/restricted_cookie_manager.cc +index 425426f..c8c10c6 100644 +--- a/services/network/restricted_cookie_manager.cc ++++ b/services/network/restricted_cookie_manager.cc +@@ -161,7 +161,7 @@ + const GURL& url, + const net::SiteForCookies& site_for_cookies) { + std::unique_ptr& entry = +- recent_cookie_accesses_[std::tie(url, site_for_cookies)]; ++ recent_cookie_accesses_[std::make_pair(url, site_for_cookies)]; + if (!entry) { + entry = std::make_unique(); + } diff --git a/chromium-96-xfce-maximize.patch b/chromium-96-xfce-maximize.patch new file mode 100644 index 0000000..77cf410 --- /dev/null +++ b/chromium-96-xfce-maximize.patch @@ -0,0 +1,51 @@ +From 245e71ae8de3f4b5f3478739be819981bb12dfab Mon Sep 17 00:00:00 2001 +From: Alexander Dunaev +Date: Sat, 13 Nov 2021 06:35:35 +0000 +Subject: [PATCH] [linux/xfce] Introduced a hack for Xfwm. + +This proposes an alternative to [1]. Either this patch or that one +should be landed, but not both. See the linked crbug for the details. + +Setting the frame extents via the _GTK_FRAME_EXTENTS property turned out +to be problematic at Xfwm. While the issue is agreed to be a bug in the +window manager, for now we disable setting the frame extents on that WM. + +This patch introduces a logic that disables setting the window property +on Xfwm. + +[1] https://chromium-review.googlesource.com/c/chromium/src/+/3275653 + +Bug: 1260821 +Change-Id: I4b734ac0dc2b97d7ed6b1842564a33ec6e4b4035 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3275272 +Reviewed-by: Thomas Anderson +Commit-Queue: Alexander Dunaev +Cr-Commit-Position: refs/heads/main@{#941444} +--- + +diff --git a/ui/platform_window/x11/x11_window.cc b/ui/platform_window/x11/x11_window.cc +index 2b20835..4fa2992 100644 +--- a/ui/platform_window/x11/x11_window.cc ++++ b/ui/platform_window/x11/x11_window.cc +@@ -1016,6 +1016,21 @@ + } + + bool X11Window::CanSetDecorationInsets() const { ++ // Xfwm handles _GTK_FRAME_EXTENTS a bit unexpected way. That is a known bug ++ // that will be eventually fixed, but for now we have to disable the function ++ // for Xfce. The block below should be removed when Xfwm is updated with the ++ // fix and is known to work properly. ++ // See https://crbug.com/1260821. ++ { ++ static WindowManagerName wm_name = WM_OTHER; ++ static bool checked_for_wm = false; ++ if (!checked_for_wm) { ++ wm_name = GuessWindowManager(); ++ checked_for_wm = true; ++ } ++ if (wm_name == WM_XFWM4) ++ return false; ++ } + return ui::WmSupportsHint(x11::GetAtom("_GTK_FRAME_EXTENTS")); + } + diff --git a/chromium-96.0.4664.45-gcc-remoting-constexpr.patch b/chromium-96.0.4664.45-gcc-remoting-constexpr.patch new file mode 100644 index 0000000..824155e --- /dev/null +++ b/chromium-96.0.4664.45-gcc-remoting-constexpr.patch @@ -0,0 +1,25 @@ +diff -up chromium-96.0.4664.45/remoting/signaling/message_tracker.cc.gcc-remoting-constexpr chromium-96.0.4664.45/remoting/signaling/message_tracker.cc +--- chromium-96.0.4664.45/remoting/signaling/message_tracker.cc.gcc-remoting-constexpr 2021-11-19 16:53:23.197177348 -0500 ++++ chromium-96.0.4664.45/remoting/signaling/message_tracker.cc 2021-11-19 17:03:16.354910826 -0500 +@@ -9,7 +9,7 @@ + namespace remoting { + + // static +-const base::TimeDelta MessageTracker::kCleanupInterval = base::Minutes(2); ++constexpr base::TimeDelta MessageTracker::kCleanupInterval; + + MessageTracker::MessageTracker() = default; + +diff -up chromium-96.0.4664.45/remoting/signaling/message_tracker.h.gcc-remoting-constexpr chromium-96.0.4664.45/remoting/signaling/message_tracker.h +--- chromium-96.0.4664.45/remoting/signaling/message_tracker.h.gcc-remoting-constexpr 2021-11-12 05:24:33.000000000 -0500 ++++ chromium-96.0.4664.45/remoting/signaling/message_tracker.h 2021-11-19 17:03:00.112809836 -0500 +@@ -40,7 +40,8 @@ class MessageTracker final { + + // All IDs older than now - kCleanupInterval will be eventually removed, but + // they are not guaranteed to be immediately removed after the interval. +- static const base::TimeDelta kCleanupInterval; ++ static constexpr base::TimeDelta kCleanupInterval = ++ base::Minutes(2); + + void RemoveExpiredIds(); + diff --git a/chromium-96.0.4664.45-missing-cstdint-header.patch b/chromium-96.0.4664.45-missing-cstdint-header.patch new file mode 100644 index 0000000..fe4e5dd --- /dev/null +++ b/chromium-96.0.4664.45-missing-cstdint-header.patch @@ -0,0 +1,35 @@ +diff -up chromium-96.0.4664.45/third_party/webrtc/common_video/h264/pps_parser.h.missing-cstdint chromium-96.0.4664.45/third_party/webrtc/common_video/h264/pps_parser.h +diff -up chromium-96.0.4664.45/third_party/webrtc/common_video/h264/sps_parser.h.missing-cstdint chromium-96.0.4664.45/third_party/webrtc/common_video/h264/sps_parser.h +--- chromium-96.0.4664.45/third_party/webrtc/common_video/h264/sps_parser.h.missing-cstdint 2021-11-19 17:05:31.379750350 -0500 ++++ chromium-96.0.4664.45/third_party/webrtc/common_video/h264/sps_parser.h 2021-11-19 17:07:35.191520127 -0500 +@@ -11,6 +11,7 @@ + #ifndef COMMON_VIDEO_H264_SPS_PARSER_H_ + #define COMMON_VIDEO_H264_SPS_PARSER_H_ + ++#include + #include "absl/types/optional.h" + #include "rtc_base/bitstream_reader.h" + +diff -up chromium-96.0.4664.45/third_party/webrtc/modules/include/module_common_types_public.h.missing-cstdint chromium-96.0.4664.45/third_party/webrtc/modules/include/module_common_types_public.h +--- chromium-96.0.4664.45/third_party/webrtc/modules/include/module_common_types_public.h.missing-cstdint 2021-11-12 05:28:10.000000000 -0500 ++++ chromium-96.0.4664.45/third_party/webrtc/modules/include/module_common_types_public.h 2021-11-19 17:05:31.379750350 -0500 +@@ -11,6 +11,7 @@ + #ifndef MODULES_INCLUDE_MODULE_COMMON_TYPES_PUBLIC_H_ + #define MODULES_INCLUDE_MODULE_COMMON_TYPES_PUBLIC_H_ + ++#include + #include + + #include "absl/types/optional.h" +diff -up chromium-96.0.4664.45/ui/gfx/linux/drm_util_linux.h.missing-cstdint chromium-96.0.4664.45/ui/gfx/linux/drm_util_linux.h +--- chromium-96.0.4664.45/ui/gfx/linux/drm_util_linux.h.missing-cstdint 2021-11-12 05:25:24.000000000 -0500 ++++ chromium-96.0.4664.45/ui/gfx/linux/drm_util_linux.h 2021-11-19 17:05:31.379750350 -0500 +@@ -9,6 +9,8 @@ + + #include "ui/gfx/buffer_types.h" + ++#include ++ + namespace ui { + + int GetFourCCFormatFromBufferFormat(gfx::BufferFormat format); diff --git a/chromium-96.0.4664.45-missing-cstring.patch b/chromium-96.0.4664.45-missing-cstring.patch new file mode 100644 index 0000000..fa8580b --- /dev/null +++ b/chromium-96.0.4664.45-missing-cstring.patch @@ -0,0 +1,47 @@ +diff -up chromium-96.0.4664.45/net/base/test_data_stream.cc.missing-cstring chromium-96.0.4664.45/net/base/test_data_stream.cc +--- chromium-96.0.4664.45/net/base/test_data_stream.cc.missing-cstring 2021-11-12 05:24:31.000000000 -0500 ++++ chromium-96.0.4664.45/net/base/test_data_stream.cc 2021-11-19 17:10:02.927438695 -0500 +@@ -5,6 +5,7 @@ + #include "net/base/test_data_stream.h" + + #include ++#include + + namespace net { + +diff -up chromium-96.0.4664.45/net/filter/filter_source_stream_test_util.cc.missing-cstring chromium-96.0.4664.45/net/filter/filter_source_stream_test_util.cc +--- chromium-96.0.4664.45/net/filter/filter_source_stream_test_util.cc.missing-cstring 2021-11-12 05:24:32.000000000 -0500 ++++ chromium-96.0.4664.45/net/filter/filter_source_stream_test_util.cc 2021-11-19 17:10:02.927438695 -0500 +@@ -4,6 +4,8 @@ + + #include "net/filter/filter_source_stream_test_util.h" + ++#include ++ + #include "base/bit_cast.h" + #include "base/check_op.h" + #include "third_party/zlib/zlib.h" +diff -up chromium-96.0.4664.45/third_party/webrtc/audio/utility/channel_mixer.cc.missing-cstring chromium-96.0.4664.45/third_party/webrtc/audio/utility/channel_mixer.cc +--- chromium-96.0.4664.45/third_party/webrtc/audio/utility/channel_mixer.cc.missing-cstring 2021-11-12 05:28:09.000000000 -0500 ++++ chromium-96.0.4664.45/third_party/webrtc/audio/utility/channel_mixer.cc 2021-11-19 17:10:02.927438695 -0500 +@@ -8,6 +8,8 @@ + * be found in the AUTHORS file in the root of the source tree. + */ + ++#include ++ + #include "audio/utility/channel_mixer.h" + + #include "audio/utility/channel_mixing_matrix.h" +diff -up chromium-96.0.4664.45/third_party/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc.missing-cstring chromium-96.0.4664.45/third_party/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc +diff -up chromium-96.0.4664.45/third_party/webrtc/modules/video_coding/utility/ivf_file_reader.cc.missing-cstring chromium-96.0.4664.45/third_party/webrtc/modules/video_coding/utility/ivf_file_reader.cc +--- chromium-96.0.4664.45/third_party/webrtc/modules/video_coding/utility/ivf_file_reader.cc.missing-cstring 2021-11-12 05:28:10.000000000 -0500 ++++ chromium-96.0.4664.45/third_party/webrtc/modules/video_coding/utility/ivf_file_reader.cc 2021-11-19 17:10:02.928438701 -0500 +@@ -10,6 +10,7 @@ + + #include "modules/video_coding/utility/ivf_file_reader.h" + ++#include + #include + #include + diff --git a/chromium-96.0.4664.45-no-const-elements-in-std-vector.patch b/chromium-96.0.4664.45-no-const-elements-in-std-vector.patch new file mode 100644 index 0000000..e866795 --- /dev/null +++ b/chromium-96.0.4664.45-no-const-elements-in-std-vector.patch @@ -0,0 +1,17 @@ +diff -up chromium-96.0.4664.45/net/test/embedded_test_server/http2_connection.cc.no-const chromium-96.0.4664.45/net/test/embedded_test_server/http2_connection.cc +--- chromium-96.0.4664.45/net/test/embedded_test_server/http2_connection.cc.no-const 2021-11-23 18:56:57.700174009 +0000 ++++ chromium-96.0.4664.45/net/test/embedded_test_server/http2_connection.cc 2021-11-23 18:57:39.405201162 +0000 +@@ -24,10 +24,9 @@ namespace net { + + namespace { + +-std::vector GenerateHeaders( +- HttpStatusCode status, +- base::StringPairs headers) { +- std::vector response_vector; ++std::vector GenerateHeaders(HttpStatusCode status, ++ base::StringPairs headers) { ++ std::vector response_vector; + response_vector.emplace_back( + http2::adapter::HeaderRep(std::string(":status")), + http2::adapter::HeaderRep(base::NumberToString(status))); diff --git a/chromium.spec b/chromium.spec index ffe724b..2a419f9 100644 --- a/chromium.spec +++ b/chromium.spec @@ -213,14 +213,14 @@ BuildRequires: libicu-devel >= 5.4 %global chromoting_client_id %nil %endif -%global majorversion 95 +%global majorversion 96 %if %{freeworld} Name: chromium%{chromium_channel}%{nsuffix} %else Name: chromium%{chromium_channel} %endif -Version: %{majorversion}.0.4638.69 +Version: %{majorversion}.0.4664.45 Release: 1%{?dist} %if %{?freeworld} %if %{?shared} @@ -253,8 +253,6 @@ Patch6: chromium-95.0.4638.69-norar.patch # Use Gentoo's Widevine hack # https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/files/chromium-widevine-r3.patch Patch7: chromium-71.0.3578.98-widevine-r3.patch -# Disable fontconfig cache magic that breaks remoting -Patch8: chromium-91.0.4472.77-disable-fontconfig-cache-magic.patch # drop rsp clobber, which breaks gcc9 (thanks to Jeff Law) Patch9: chromium-94.0.4606.54-gcc9-drop-rsp-clobber.patch # Try to load widevine from other places @@ -268,52 +266,50 @@ Patch11: chromium-92.0.4515.107-py2-bootstrap.patch # Add "Fedora" to the user agent string Patch12: chromium-86.0.4240.75-fedora-user-agent.patch -# https://gitweb.gentoo.org/repo/gentoo.git/plain/www-client/chromium/files/chromium-95-maldoca-zlib.patch -Patch20: chromium-95-maldoca-zlib.patch - -# https://gitweb.gentoo.org/repo/gentoo.git/plain/www-client/chromium/files/chromium-95-eigen-avx-1.patch -# https://gitweb.gentoo.org/repo/gentoo.git/plain/www-client/chromium/files/chromium-95-eigen-avx-2.patch -# https://gitweb.gentoo.org/repo/gentoo.git/plain/www-client/chromium/files/chromium-95-eigen-avx-3.patch -Patch21: chromium-95-eigen-avx-1.patch -Patch22: chromium-95-eigen-avx-2.patch -Patch23: chromium-95-eigen-avx-3.patch - -# https://gitweb.gentoo.org/repo/gentoo.git/plain/www-client/chromium/files/chromium-95-xfce-maximize.patch -Patch24: chromium-95-xfce-maximize.patch +# https://gitweb.gentoo.org/repo/gentoo.git/plain/www-client/chromium/files/chromium-96-xfce-maximize.patch +Patch24: chromium-96-xfce-maximize.patch # Needs to be submitted.. -Patch51: chromium-76.0.3809.100-gcc-remoting-constexpr.patch +Patch51: chromium-96.0.4664.45-gcc-remoting-constexpr.patch # https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/files/chromium-unbundle-zlib.patch Patch52: chromium-81.0.4044.92-unbundle-zlib.patch # https://github.com/stha09/chromium-patches/blob/master/chromium-78-protobuf-RepeatedPtrField-export.patch Patch55: chromium-78-protobuf-RepeatedPtrField-export.patch # ../../third_party/perfetto/include/perfetto/base/task_runner.h:48:55: error: 'uint32_t' has not been declared -Patch56: chromium-80.0.3987.87-missing-cstdint-header.patch +Patch56: chromium-96.0.4664.45-missing-cstdint-header.patch # Missing (thanks c++17) -Patch57: chromium-95.0.4638.69-missing-cstring.patch +Patch57: chromium-96.0.4664.45-missing-cstring.patch # prepare for using system ffmpeg (clean) # http://svnweb.mageia.org/packages/cauldron/chromium-browser-stable/current/SOURCES/chromium-53-ffmpeg-no-deprecation-errors.patch?view=markup Patch58: chromium-53-ffmpeg-no-deprecation-errors.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-96-CouponDB-include.patch +Patch59: chromium-96-CouponDB-include.patch # https://github.com/stha09/chromium-patches/blob/master/chromium-95-libyuv-aarch64.patch Patch60: chromium-95-libyuv-aarch64.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-95-quiche-include.patch -Patch61: chromium-95-quiche-include.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-95-BitstreamReader-namespace.patch -Patch62: chromium-95-BitstreamReader-namespace.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-96-CommandLine-include.patch +Patch61: chromium-96-CommandLine-include.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-96-RestrictedCookieManager-tuple.patch +Patch62: chromium-96-RestrictedCookieManager-tuple.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-96-DrmRenderNodePathFinder-include.patch +Patch63: chromium-96-DrmRenderNodePathFinder-include.patch # Extra CXXFLAGS for aarch64 -Patch63: chromium-91.0.4472.77-aarch64-cxxflags-addition.patch +Patch64: chromium-91.0.4472.77-aarch64-cxxflags-addition.patch # Fix issue where closure_compiler thinks java is only allowed in android builds # https://bugs.chromium.org/p/chromium/issues/detail?id=1192875 -Patch64: chromium-91.0.4472.77-java-only-allowed-in-android-builds.patch +Patch65: chromium-91.0.4472.77-java-only-allowed-in-android-builds.patch # Silence GCC warnings during gn compile -Patch65: chromium-92.0.4515.107-gn-gcc-cleanup.patch +Patch66: chromium-92.0.4515.107-gn-gcc-cleanup.patch # Fix missing cstring in remoting code -Patch66: chromium-84.0.4147.125-remoting-cstring.patch +Patch67: chromium-84.0.4147.125-remoting-cstring.patch # Apply fix_textrels hack for i686 (even without lld) -Patch67: chromium-84.0.4147.125-i686-fix_textrels.patch +Patch68: chromium-84.0.4147.125-i686-fix_textrels.patch # Work around binutils bug in aarch64 (F33+) -Patch68: chromium-84.0.4147.125-aarch64-clearkeycdm-binutils-workaround.patch +Patch69: chromium-84.0.4147.125-aarch64-clearkeycdm-binutils-workaround.patch +# No const elements in std::vector +# https://github.com/chromium/chromium/commit/fd8ee2daf64a4348abca5dc9171523a1f9540c57#diff-45309c0989d0ee3ef14c373b6032b235c928574f72ac81e0b2ad8abf95c34547 +Patch70: chromium-96.0.4664.45-no-const-elements-in-std-vector.patch + # Rawhide (f35) glibc defines SIGSTKSZ as a long instead of a constant Patch76: chromium-92.0.4515.107-rawhide-gcc-std-max-fix.patch # Do not download proprietary widevine module in the background (thanks Debian) @@ -321,23 +317,13 @@ Patch79: chromium-93.0.4577.63-widevine-no-download.patch # Fix crashes with components/cast_* # Thanks to Gentoo -Patch80: chromium-92.0.4515.107-EnumTable-crash.patch -# Fixes for python3 -Patch83: chromium-92.0.4515.107-py3-fixes.patch +Patch80: chromium-96-EnumTable-crash.patch # Add missing cmath header Patch84: chromium-94.0.4606.71-remoting-missing-cmath-header.patch # Clean up clang-format for python3 # thanks to Jon Nettleton Patch86: chromium-94.0.4606.81-clang-format.patch -# In file included from ../../components/cast_channel/enum_table.cc:5: -# ../../components/cast_channel/enum_table.h:359:18: error: 'vector' in namespace 'std' does not name a template type -# 359 | const std::vector data_; -# | ^~~~~~ -# ../../components/cast_channel/enum_table.h:18:1: note: 'std::vector' is defined in header ''; did you forget to '#include '? -Patch93: chromium-93.0.4577.63-vector-fix.patch -# Fix NoDestructor issue with gcc -Patch94: chromium-94.0.4606.54-remoting-nodestructor-fix.patch # include full UrlResponseHead header Patch95: chromium-93.0.4577.63-mojo-header-fix.patch # Fix multiple defines issue in webrtc/BUILD.gn @@ -346,9 +332,6 @@ Patch96: chromium-94.0.4606.54-webrtc-BUILD.gn-fix-multiple-defines.patch Patch97: chromium-94.0.4606.61-remoting-extra-qualification.patch # From gentoo Patch98: chromium-94.0.4606.71-InkDropHost-crash.patch -# From upstream -# https://chromium.googlesource.com/chromium/src/+/403393b908cefaed09592a4f25fe2cbd46317a68%5E%21/#F0 -Patch99: chromium-94.0.4606.71-PartitionFree-nullptr-fix.patch @@ -995,7 +978,6 @@ udev. %patch5 -p1 -b .nozlibmangle %patch6 -p1 -b .nounrar %patch7 -p1 -b .widevine-hack -%patch8 -p1 -b .nofontconfigcache %patch9 -p1 -b .gcc9 %patch10 -p1 -b .widevine-other-locations %if 0%{?build_with_python3} @@ -1003,10 +985,6 @@ udev. %endif # Short term fixes (usually gcc and backports) -%patch20 -p1 -b .maldoca-zlib -%patch21 -p1 -b .eigen-avx-1 -%patch22 -p1 -b .eigen-avx-2 -%patch23 -p1 -b .eigen-avx-3 %patch24 -p1 -b .xfce-maximize %patch51 -p1 -b .gcc-remoting-constexpr @@ -1017,30 +995,29 @@ udev. %patch56 -p1 -b .missing-cstdint %patch57 -p1 -b .missing-cstring %patch58 -p1 -b .ffmpeg-deprecations +%patch59 -p1 -b .CouponDB-include %patch60 -p1 -b .libyuv-aarch64 -%patch61 -p1 -b .quiche-include -%patch62 -p1 -b .BitstreamReader-namespace -%patch63 -p1 -b .aarch64-cxxflags-addition -%patch64 -p1 -b .java-only-allowed -%patch65 -p1 -b .gn-gcc-cleanup -%patch66 -p1 -b .remoting-cstring -%patch67 -p1 -b .i686-textrels -%patch68 -p1 -b .aarch64-clearkeycdm-binutils-workaround +%patch61 -p1 -b .CommandLine-include +%patch62 -p1 -b .RestrictedCookieManager-tuple +%patch63 -p1 -b .DrmRenderNodePathFinder-include +%patch64 -p1 -b .aarch64-cxxflags-addition +%patch65 -p1 -b .java-only-allowed +%patch66 -p1 -b .gn-gcc-cleanup +%patch67 -p1 -b .remoting-cstring +%patch68 -p1 -b .i686-textrels +%patch69 -p1 -b .aarch64-clearkeycdm-binutils-workaround +%patch70 -p1 -b .no-const-elements-in-std-vector %if 0%{?fedora} >= 35 %patch76 -p1 -b .sigstkszfix %endif %patch79 -p1 -b .widevine-no-download %patch80 -p1 -b .EnumTable-crash -%patch83 -p1 -b .py3fixes %patch84 -p1 -b .remoting-missing-cmath-header %patch86 -p1 -b .clang-format-py3 -%patch93 -p1 -b .vector-fix -%patch94 -p1 -b .remoting-nodestructor-fix %patch95 -p1 -b .mojo-header-fix %patch96 -p1 -b .webrtc-BUILD.gn-fix-multiple-defines %patch97 -p1 -b .remoting-extra-qualification %patch98 -p1 -b .InkDropHost-crash -%patch99 -p1 -b .PartitionFree-nullptr-fix # Fedora branded user agent %if 0%{?fedora} @@ -1349,6 +1326,7 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/devtools-frontend/src/front_end/third_party/wasmparser' \ 'third_party/devtools-frontend/src/test/unittests/front_end/third_party/i18n' \ 'third_party/devtools-frontend/src/third_party' \ + 'third_party/distributed_point_functions' \ 'third_party/dom_distiller_js' \ 'third_party/eigen3' \ 'third_party/emoji-segmenter' \ @@ -1494,7 +1472,6 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/tflite' \ 'third_party/tflite/src/third_party/eigen3' \ 'third_party/tflite/src/third_party/fft2d' \ - 'third_party/tflite-support' \ 'third_party/ukey2' \ 'third_party/usb_ids' \ 'third_party/usrsctp' \ @@ -2140,6 +2117,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Fri Nov 19 2021 Tom Callaway - 96.0.4664.45-1 +- update to 96.0.4664.45 + * Fri Nov 12 2021 Tom Callaway - 95.0.4638.69-1 - update to 95.0.4638.69 diff --git a/clean_ffmpeg.sh b/clean_ffmpeg.sh index 002dae9..60a40b4 100755 --- a/clean_ffmpeg.sh +++ b/clean_ffmpeg.sh @@ -238,6 +238,7 @@ manual_files=" libavcodec/aarch64/fft_neon.S \ libavcodec/mdct15.c \ libavcodec/mdct_template.c \ libavcodec/options.c \ + libavcodec/pcm.c \ libavcodec/pel_template.c \ libavcodec/utils.c \ libavcodec/videodsp.c \ diff --git a/sources b/sources index 36e32cf..8986f70 100644 --- a/sources +++ b/sources @@ -21,4 +21,4 @@ SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1d SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a SHA512 (node-v12.22.6-linux-arm64.tar.xz) = 87ce5eb954deb1d0debe6fa02b28a3cc675e12fca1e51d44b123ab294aa39ce0c6b8ac9eae1e7a6e32673ea2c2d480651d9ba7eea73012f0529503eebe9eb34d SHA512 (node-v12.22.6-linux-x64.tar.xz) = e1b55c32343cb2ccc40d888c705414bebf9c46b02083d13731df79b1e79521b7277761f6bcca041e40e3a2e47c67bb8e7848aa2b919a9de5c2ebf62c4a9c7176 -SHA512 (chromium-95.0.4638.69-clean.tar.xz) = b4e7c917300ead59492b0817a3a73f74cebdb6daa62d90edf5f7df8a4de2cdeb100d45811611b5251bd50dab363ec54090fa39cfa97c7a194bdd6bca6c5e4072 +SHA512 (chromium-96.0.4664.45-clean.tar.xz) = b997cd95b5cf991e0352448c3ce635ada62fe49d3cc92d60f8dabf00cc6a202584f12b30e9a0d687163dee76892822b0d7d46a2d9737d0aa22d3992dfd31d706 From 558eeefbb3a1af818c21596c6a146bd56b33521b Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Fri, 17 Dec 2021 10:21:28 -0500 Subject: [PATCH 060/659] 96.0.4664.110 --- chromium.spec | 10 ++++------ sources | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/chromium.spec b/chromium.spec index 2a419f9..647a365 100644 --- a/chromium.spec +++ b/chromium.spec @@ -220,7 +220,7 @@ Name: chromium%{chromium_channel}%{nsuffix} %else Name: chromium%{chromium_channel} %endif -Version: %{majorversion}.0.4664.45 +Version: %{majorversion}.0.4664.110 Release: 1%{?dist} %if %{?freeworld} %if %{?shared} @@ -266,9 +266,6 @@ Patch11: chromium-92.0.4515.107-py2-bootstrap.patch # Add "Fedora" to the user agent string Patch12: chromium-86.0.4240.75-fedora-user-agent.patch -# https://gitweb.gentoo.org/repo/gentoo.git/plain/www-client/chromium/files/chromium-96-xfce-maximize.patch -Patch24: chromium-96-xfce-maximize.patch - # Needs to be submitted.. Patch51: chromium-96.0.4664.45-gcc-remoting-constexpr.patch # https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/files/chromium-unbundle-zlib.patch @@ -985,8 +982,6 @@ udev. %endif # Short term fixes (usually gcc and backports) -%patch24 -p1 -b .xfce-maximize - %patch51 -p1 -b .gcc-remoting-constexpr %if 0%{?fedora} || 0%{?rhel} >= 8 %patch52 -p1 -b .unbundle-zlib @@ -2117,6 +2112,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Thu Dec 16 2021 Tom Callaway - 96.0.4664.110-1 +- update to 96.0.4664.110 + * Fri Nov 19 2021 Tom Callaway - 96.0.4664.45-1 - update to 96.0.4664.45 diff --git a/sources b/sources index 8986f70..1f17460 100644 --- a/sources +++ b/sources @@ -21,4 +21,4 @@ SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1d SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a SHA512 (node-v12.22.6-linux-arm64.tar.xz) = 87ce5eb954deb1d0debe6fa02b28a3cc675e12fca1e51d44b123ab294aa39ce0c6b8ac9eae1e7a6e32673ea2c2d480651d9ba7eea73012f0529503eebe9eb34d SHA512 (node-v12.22.6-linux-x64.tar.xz) = e1b55c32343cb2ccc40d888c705414bebf9c46b02083d13731df79b1e79521b7277761f6bcca041e40e3a2e47c67bb8e7848aa2b919a9de5c2ebf62c4a9c7176 -SHA512 (chromium-96.0.4664.45-clean.tar.xz) = b997cd95b5cf991e0352448c3ce635ada62fe49d3cc92d60f8dabf00cc6a202584f12b30e9a0d687163dee76892822b0d7d46a2d9737d0aa22d3992dfd31d706 +SHA512 (chromium-96.0.4664.110-clean.tar.xz) = 87b72035e1c9f4b41f82e9fe9f47d2f1fdd16393ca851509bd76d843fe12c70da53452390f9cdc1dfcc660318fe3d8c91dd7d53ec2d927dc4dbbef6e36baca44 From 1d2f054da38e4d0f9c512e4bd0760a7dd29e9d02 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Mon, 20 Dec 2021 11:28:13 -0500 Subject: [PATCH 061/659] enable WebRTCPipeWireCapturer by default --- ...110-enable-WebRTCPipeWireCapturer-byDefault.patch | 12 ++++++++++++ chromium.spec | 8 +++++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 chromium-96.0.4664.110-enable-WebRTCPipeWireCapturer-byDefault.patch diff --git a/chromium-96.0.4664.110-enable-WebRTCPipeWireCapturer-byDefault.patch b/chromium-96.0.4664.110-enable-WebRTCPipeWireCapturer-byDefault.patch new file mode 100644 index 0000000..9d22e71 --- /dev/null +++ b/chromium-96.0.4664.110-enable-WebRTCPipeWireCapturer-byDefault.patch @@ -0,0 +1,12 @@ +diff -up chromium-96.0.4664.110/content/public/common/content_features.cc.enable-WebRTCPipeWireCapturer-byDefault chromium-96.0.4664.110/content/public/common/content_features.cc +--- chromium-96.0.4664.110/content/public/common/content_features.cc.enable-WebRTCPipeWireCapturer-byDefault 2021-12-20 11:24:28.862940185 -0500 ++++ chromium-96.0.4664.110/content/public/common/content_features.cc 2021-12-20 11:24:43.397027114 -0500 +@@ -1125,7 +1125,7 @@ const base::Feature kAuraWindowSubtreeCa + // Controls whether the PipeWire support for screen capturing is enabled on the + // Wayland display server. + const base::Feature kWebRtcPipeWireCapturer{"WebRTCPipeWireCapturer", +- base::FEATURE_DISABLED_BY_DEFAULT}; ++ base::FEATURE_ENABLED_BY_DEFAULT}; + #endif // defined(WEBRTC_USE_PIPEWIRE) + + enum class VideoCaptureServiceConfiguration { diff --git a/chromium.spec b/chromium.spec index 647a365..2fff863 100644 --- a/chromium.spec +++ b/chromium.spec @@ -221,7 +221,7 @@ Name: chromium%{chromium_channel}%{nsuffix} Name: chromium%{chromium_channel} %endif Version: %{majorversion}.0.4664.110 -Release: 1%{?dist} +Release: 2%{?dist} %if %{?freeworld} %if %{?shared} # chromium-libs-media-freeworld @@ -329,6 +329,8 @@ Patch96: chromium-94.0.4606.54-webrtc-BUILD.gn-fix-multiple-defines.patch Patch97: chromium-94.0.4606.61-remoting-extra-qualification.patch # From gentoo Patch98: chromium-94.0.4606.71-InkDropHost-crash.patch +# Enable WebRTCPPipeWireCapturer by default +Patch99: chromium-96.0.4664.110-enable-WebRTCPipeWireCapturer-byDefault.patch @@ -1013,6 +1015,7 @@ udev. %patch96 -p1 -b .webrtc-BUILD.gn-fix-multiple-defines %patch97 -p1 -b .remoting-extra-qualification %patch98 -p1 -b .InkDropHost-crash +%patch99 -p1 -b .enable-WebRTCPipeWireCapturer-byDefault # Fedora branded user agent %if 0%{?fedora} @@ -2112,6 +2115,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Mon Dec 20 2021 Tom Callaway - 96.0.4664.110-2 +- enable WebRTCPipeWireCapturer by default + * Thu Dec 16 2021 Tom Callaway - 96.0.4664.110-1 - update to 96.0.4664.110 From 7ac8cdd3f0454d59086e9918b3cac45a02afe5a0 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Mon, 27 Dec 2021 11:39:46 -0500 Subject: [PATCH 062/659] have chromium-browser.sh check for wayland env vars and if found, set ozone flags appropriately. Thanks to Neal Gompa for the nudge --- chromium-browser.sh | 5 +++++ chromium.spec | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/chromium-browser.sh b/chromium-browser.sh index d76aabe..82527cb 100755 --- a/chromium-browser.sh +++ b/chromium-browser.sh @@ -50,6 +50,11 @@ CHROMIUM_DISTRO_FLAGS=" --enable-plugins \ --enable-sync \ --auto-ssl-client-auth @@EXTRA_FLAGS@@" +# This provides a much better experience on Wayland. +if [ "$XDG_SESSION_TYPE" == "wayland" ] || [[ $WAYLAND_DISPLAY ]] ; then + CHROMIUM_DISTRO_FLAGS="--enable-features=UseOzonePlatform --ozone-platform=wayland $CHROMIUM_DISTRO_FLAGS" +fi + if [ -f "$HERE/PepperFlash/libpepflashplayer.so" ] && [ -f "$HERE/PepperFlash/manifest.json" ] ; then CHROMIUM_FLASH_VERSION=$(grep '"version":' "$HERE/PepperFlash/manifest.json" | awk -F\" '{ print $4 }') CHROMIUM_FLASH_FLAGS=" --ppapi-flash-path=$HERE/PepperFlash/libpepflashplayer.so \ diff --git a/chromium.spec b/chromium.spec index 2fff863..18ac2b2 100644 --- a/chromium.spec +++ b/chromium.spec @@ -221,7 +221,7 @@ Name: chromium%{chromium_channel}%{nsuffix} Name: chromium%{chromium_channel} %endif Version: %{majorversion}.0.4664.110 -Release: 2%{?dist} +Release: 3%{?dist} %if %{?freeworld} %if %{?shared} # chromium-libs-media-freeworld @@ -2115,6 +2115,10 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Mon Dec 27 2021 Tom Callaway - 96.0.4664.110-3 +- have chromium-browser.sh check for wayland env vars and if found, set ozone flags appropriately + Thanks to Neal Gompa for the nudge + * Mon Dec 20 2021 Tom Callaway - 96.0.4664.110-2 - enable WebRTCPipeWireCapturer by default From 19df435c6d5f35e2dd8a312e244d9bf52d7095f3 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Mon, 27 Dec 2021 11:56:30 -0500 Subject: [PATCH 063/659] drop enable-features flag, not needed, makes things more complicated --- chromium-browser.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chromium-browser.sh b/chromium-browser.sh index 82527cb..b0ace53 100755 --- a/chromium-browser.sh +++ b/chromium-browser.sh @@ -52,7 +52,7 @@ CHROMIUM_DISTRO_FLAGS=" --enable-plugins \ # This provides a much better experience on Wayland. if [ "$XDG_SESSION_TYPE" == "wayland" ] || [[ $WAYLAND_DISPLAY ]] ; then - CHROMIUM_DISTRO_FLAGS="--enable-features=UseOzonePlatform --ozone-platform=wayland $CHROMIUM_DISTRO_FLAGS" + CHROMIUM_DISTRO_FLAGS="--ozone-platform=wayland $CHROMIUM_DISTRO_FLAGS" fi if [ -f "$HERE/PepperFlash/libpepflashplayer.so" ] && [ -f "$HERE/PepperFlash/manifest.json" ] ; then From 84db931a4e1ce962eab6780445a7612437a97f7a Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Thu, 30 Dec 2021 16:37:32 -0500 Subject: [PATCH 064/659] package up more swiftshader/angle stuff, move swiftshader files to -common so headless can use them --- chromium.spec | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/chromium.spec b/chromium.spec index 18ac2b2..84d5486 100644 --- a/chromium.spec +++ b/chromium.spec @@ -221,7 +221,7 @@ Name: chromium%{chromium_channel}%{nsuffix} Name: chromium%{chromium_channel} %endif Version: %{majorversion}.0.4664.110 -Release: 3%{?dist} +Release: 4%{?dist} %if %{?freeworld} %if %{?shared} # chromium-libs-media-freeworld @@ -1722,6 +1722,9 @@ rm -rf %{buildroot} cp -a *.pak locales resources icudtl.dat %{buildroot}%{chromium_path} %ifarch x86_64 i686 aarch64 cp -a swiftshader %{buildroot}%{chromium_path} + cp -a libvk_swiftshader.so* %{buildroot}%{chromium_path} + cp -a libvulkan.so* %{buildroot}%{chromium_path} + cp -a vk_swiftshader_icd.json %{buildroot}%{chromium_path} %endif cp -a chrome %{buildroot}%{chromium_path}/%{chromium_browser_channel} cp -a chrome_sandbox %{buildroot}%{chromium_path}/chrome-sandbox @@ -1965,9 +1968,6 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %{chromium_path}/libEGL.so* %{chromium_path}/libGLESv2.so* %{chromium_path}/MEIPreload/ -%ifarch x86_64 i686 aarch64 -%{chromium_path}/swiftshader/ -%endif %dir %{chromium_path}/PepperFlash/ %if 0 %{chromium_path}/protoc @@ -1996,6 +1996,12 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %{chromium_path}/pyproto/ %endif %{chromium_path}/resources/ +%ifarch x86_64 i686 aarch64 +%{chromium_path}/swiftshader/ +%{chromium_path}/libvk_swiftshader.so* +%{chromium_path}/libvulkan.so* +%{chromium_path}/vk_swiftshader_icd.json +%endif %dir %{chromium_path}/locales/ %lang(am) %{chromium_path}/locales/am.pak* %lang(ar) %{chromium_path}/locales/ar.pak* @@ -2115,6 +2121,10 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Thu Dec 30 2021 Tom Callaway - 96.0.4664.110-4 +- package up more swiftshader/angle stuff +- move swiftshader files to -common so headless can use them + * Mon Dec 27 2021 Tom Callaway - 96.0.4664.110-3 - have chromium-browser.sh check for wayland env vars and if found, set ozone flags appropriately Thanks to Neal Gompa for the nudge From 4182e43ca5c914c018a9d19e0f3cb98746212f35 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Mon, 3 Jan 2022 15:01:10 -0500 Subject: [PATCH 065/659] fix provides filtering to be more inclusive (and work properly) --- chromium.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/chromium.spec b/chromium.spec index 84d5486..5363c93 100644 --- a/chromium.spec +++ b/chromium.spec @@ -109,7 +109,7 @@ %if 0%{?shared} -%global __provides_exclude_from %{chromium_path}/.*\\.so|%{chromium_path}/lib/.*\\.so|%{chromium_path}/lib/.*\\.so.* +%global __provides_exclude_from ^(%{chromium_path}/.*\\.so*|%{chromium_path}/lib/.*\\.so|%{chromium_path}/lib/.*\\.so.*)$ %if 0%{?rhel} == 7 %global privlibs libaccessibility|libandroid_mojo_bindings_shared|libanimation|libapdu|libaura|libaura_extra|libauthenticator_test_mojo_bindings_shared|libbase|libbase_i18n|libbindings|libbindings_base|libblink_common|libblink_controller|libblink_core|libblink_embedded_frame_sink_mojo_bindings_shared|libblink_features|libblink_modules|libblink_mojom_broadcastchannel_bindings_shared|libblink_platform|libbluetooth|libboringssl|libbrowser_ui_views|libcaptive_portal|libcapture_base|libcapture_lib|libcbor|libcc|libcc_animation|libcc_base|libcc_debug|libcc_ipc|libcc_mojo_embedder|libcc_paint|libcertificate_matching|libcert_verifier|libchrome_features|libchromium_sqlite3|libclearkeycdm|libclient|libcloud_policy_proto_generated_compile|libcodec|libcolor_space|libcolor_utils|libcommon|libcompositor|libcontent|libcontent_common_mojo_bindings_shared|libcontent_public_common_mojo_bindings_shared|libcontent_service_cpp|libcontent_service_mojom|libcontent_service_mojom_shared|libcontent_settings_features|libcrash_key_lib|libcrcrypto|libcrdtp|libdbus|libdevice_base|libdevice_event_log|libdevice_features|libdevice_gamepad|libdevices|libdevice_vr|libdevice_vr_mojo_bindings|libdevice_vr_mojo_bindings_blink|libdevice_vr_mojo_bindings_shared|libdevice_vr_test_mojo_bindings|libdevice_vr_test_mojo_bindings_blink|libdevice_vr_test_mojo_bindings_shared|libdiscardable_memory_client|libdiscardable_memory_common|libdiscardable_memory_service|libdisplay|libdisplay_types|libdisplay_util|libdomain_reliability|libdom_storage_mojom|libdom_storage_mojom_shared|libEGL|libEGL|libembedder|libembedder_switches|libevents|libevents_base|libevents_devices_x11|libevents_ozone_layout|libevents_x|libextras|libffmpeg|libfido|libfingerprint|libfreetype_harfbuzz|libgamepad_mojom|libgamepad_mojom_blink|libgamepad_mojom_shared|libgamepad_shared_typemap_traits|libgcm|libgeometry|libgeometry_skia|libgesture_detection|libgfx|libgfx_ipc|libgfx_ipc_buffer_types|libgfx_ipc_color|libgfx_ipc_geometry|libgfx_ipc_skia|libgfx_switches|libgfx_x11|libgin|libgles2|libgles2_implementation|libgles2_utils|libGLESv2|libGLESv2|libgl_init|libgl_in_process_context|libgl_wrapper|libgpu|libgpu_ipc_service|libgtkui|libheadless_non_renderer|libhost|libicui18n|libicuuc|libinterfaces_shared|libipc|libipc_mojom|libipc_mojom_shared|libkeycodes_x11|libkeyed_service_content|libkeyed_service_core|liblearning_common|liblearning_impl|libleveldatabase|libleveldb_proto|libmanager|libmedia|libmedia_blink|libmedia_gpu|libmedia_learning_mojo_impl|libmedia_message_center|libmedia_mojo_services|libmedia_session_base_cpp|libmedia_session_cpp|libmedia_webrtc|libmemory_instrumentation|libmenu|libmessage_center|libmessage_support|libmetrics_cpp|libmidi|libmirroring_service|libmojo_base_lib|libmojo_base_mojom|libmojo_base_mojom_blink|libmojo_base_mojom_shared|libmojo_base_shared_typemap_traits|libmojo_core_embedder|libmojo_core_embedder_internal|libmojo_core_ports|libmojo_cpp_platform|libmojom_core_shared|libmojom_mhtml_load_result_shared|libmojom_modules_shared|libmojo_mojom_bindings|libmojo_mojom_bindings_shared|libmojom_platform_shared|libmojo_public_system|libmojo_public_system_cpp|libnative_theme|libnet|libnetwork_cpp|libnetwork_cpp_base|libnetwork_service|libnetwork_session_configurator|libonc|libos_crypt|libparsers|libpdfium|libperfetto|libperformace_manager_public_mojom|libperformace_manager_public_mojom_blink|libperformace_manager_public_mojom_shared|libplatform|libplatform_window|libplatform_window_common|libplatform_window_handler_libs|libpolicy_component|libpolicy_proto|libppapi_host|libppapi_proxy|libppapi_shared|libprefs|libprinting|libproperties|libprotobuf_lite|libproxy_config|libpublic|librange|libraster|libresource_coordinator_public_mojom|libresource_coordinator_public_mojom_blink|libresource_coordinator_public_mojom_shared|libsandbox|libsandbox_services|libscheduling_metrics|libseccomp_bpf|libsecurity_state_features|libservice|libservice_manager_cpp|libservice_manager_cpp_types|libservice_manager_mojom|libservice_manager_mojom_blink|libservice_manager_mojom_constants|libservice_manager_mojom_constants_blink|libservice_manager_mojom_constants_shared|libservice_manager_mojom_shared|libservice_manager_mojom_traits|libservice_provider|libsessions|libshared_memory_support|libshared_with_blink|libshell_dialogs|libskia|libskia_shared_typemap_traits|libsnapshot|libsql|libstartup_tracing|libstorage_browser|libstorage_common|libstorage_service_public|libstub_window|libsuid_sandbox_client|libsurface|libsystem_media_controls|libtab_count_metrics|libthread_linux|libtracing|libtracing_cpp|libtracing_mojom|libtracing_mojom_shared|libui_accessibility_ax_mojom|libui_accessibility_ax_mojom_blink|libui_accessibility_ax_mojom_shared|libui_base|libui_base_clipboard|libui_base_clipboard_types|libui_base_features|libui_base_idle|libui_base_ime|libui_base_ime_init|libui_base_ime_linux|libui_base_ime_types|libui_base_x|libui_data_pack|libui_devtools|libui_message_center_cpp|libui_touch_selection|liburl|liburl_ipc|liburl_matcher|libusb_shared|libuser_manager|libuser_prefs|libv8|libv8_libbase|libv8_libplatform|libviews|libviz_common|libviz_resource_format_utils|libviz_vulkan_context_provider|libVkICD_mock_icd|libvk_swiftshader|libvr_base|libvr_common|libvulkan_info|libvulkan_init|libvulkan_wrapper|libvulkan_x11|libvulkan_ycbcr_info|libweb_bluetooth_mojo_bindings_shared|libwebdata_common|libweb_dialogs|libweb_feature_mojo_bindings_mojom|libweb_feature_mojo_bindings_mojom_blink|libweb_feature_mojo_bindings_mojom_shared|libwebgpu|libweb_modal|libwebrtc_component|libwebview|libwm|libwm_public|libwtf|libwtf_support|libx11_events_platform|libx11_window|libzygote|libfontconfig %else @@ -221,7 +221,7 @@ Name: chromium%{chromium_channel}%{nsuffix} Name: chromium%{chromium_channel} %endif Version: %{majorversion}.0.4664.110 -Release: 4%{?dist} +Release: 5%{?dist} %if %{?freeworld} %if %{?shared} # chromium-libs-media-freeworld @@ -2121,6 +2121,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Mon Jan 3 2021 Tom Callaway - 96.0.4664.110-5 +- fix provides filtering to be more inclusive (and work properly) + * Thu Dec 30 2021 Tom Callaway - 96.0.4664.110-4 - package up more swiftshader/angle stuff - move swiftshader files to -common so headless can use them From 5d7ec667a0a9f86422593bdfb0e9fbd31bb7d358 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Tue, 4 Jan 2022 10:41:12 -0500 Subject: [PATCH 066/659] always filter provides, was previously inside conditional for shared builds --- chromium.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/chromium.spec b/chromium.spec index 5363c93..1a9cd2b 100644 --- a/chromium.spec +++ b/chromium.spec @@ -105,11 +105,11 @@ # for RHEL7, append libfontconfig to the end # make sure there is not a trailing | at the end of the list -# We don't really need to do this unless we're building shared. +# We always filter provides. We only filter Requires when building shared. +%global __provides_exclude_from ^(%{chromium_path}/.*\\.so*|%{chromium_path}/lib/.*\\.so|%{chromium_path}/lib/.*\\.so.*)$ %if 0%{?shared} -%global __provides_exclude_from ^(%{chromium_path}/.*\\.so*|%{chromium_path}/lib/.*\\.so|%{chromium_path}/lib/.*\\.so.*)$ %if 0%{?rhel} == 7 %global privlibs libaccessibility|libandroid_mojo_bindings_shared|libanimation|libapdu|libaura|libaura_extra|libauthenticator_test_mojo_bindings_shared|libbase|libbase_i18n|libbindings|libbindings_base|libblink_common|libblink_controller|libblink_core|libblink_embedded_frame_sink_mojo_bindings_shared|libblink_features|libblink_modules|libblink_mojom_broadcastchannel_bindings_shared|libblink_platform|libbluetooth|libboringssl|libbrowser_ui_views|libcaptive_portal|libcapture_base|libcapture_lib|libcbor|libcc|libcc_animation|libcc_base|libcc_debug|libcc_ipc|libcc_mojo_embedder|libcc_paint|libcertificate_matching|libcert_verifier|libchrome_features|libchromium_sqlite3|libclearkeycdm|libclient|libcloud_policy_proto_generated_compile|libcodec|libcolor_space|libcolor_utils|libcommon|libcompositor|libcontent|libcontent_common_mojo_bindings_shared|libcontent_public_common_mojo_bindings_shared|libcontent_service_cpp|libcontent_service_mojom|libcontent_service_mojom_shared|libcontent_settings_features|libcrash_key_lib|libcrcrypto|libcrdtp|libdbus|libdevice_base|libdevice_event_log|libdevice_features|libdevice_gamepad|libdevices|libdevice_vr|libdevice_vr_mojo_bindings|libdevice_vr_mojo_bindings_blink|libdevice_vr_mojo_bindings_shared|libdevice_vr_test_mojo_bindings|libdevice_vr_test_mojo_bindings_blink|libdevice_vr_test_mojo_bindings_shared|libdiscardable_memory_client|libdiscardable_memory_common|libdiscardable_memory_service|libdisplay|libdisplay_types|libdisplay_util|libdomain_reliability|libdom_storage_mojom|libdom_storage_mojom_shared|libEGL|libEGL|libembedder|libembedder_switches|libevents|libevents_base|libevents_devices_x11|libevents_ozone_layout|libevents_x|libextras|libffmpeg|libfido|libfingerprint|libfreetype_harfbuzz|libgamepad_mojom|libgamepad_mojom_blink|libgamepad_mojom_shared|libgamepad_shared_typemap_traits|libgcm|libgeometry|libgeometry_skia|libgesture_detection|libgfx|libgfx_ipc|libgfx_ipc_buffer_types|libgfx_ipc_color|libgfx_ipc_geometry|libgfx_ipc_skia|libgfx_switches|libgfx_x11|libgin|libgles2|libgles2_implementation|libgles2_utils|libGLESv2|libGLESv2|libgl_init|libgl_in_process_context|libgl_wrapper|libgpu|libgpu_ipc_service|libgtkui|libheadless_non_renderer|libhost|libicui18n|libicuuc|libinterfaces_shared|libipc|libipc_mojom|libipc_mojom_shared|libkeycodes_x11|libkeyed_service_content|libkeyed_service_core|liblearning_common|liblearning_impl|libleveldatabase|libleveldb_proto|libmanager|libmedia|libmedia_blink|libmedia_gpu|libmedia_learning_mojo_impl|libmedia_message_center|libmedia_mojo_services|libmedia_session_base_cpp|libmedia_session_cpp|libmedia_webrtc|libmemory_instrumentation|libmenu|libmessage_center|libmessage_support|libmetrics_cpp|libmidi|libmirroring_service|libmojo_base_lib|libmojo_base_mojom|libmojo_base_mojom_blink|libmojo_base_mojom_shared|libmojo_base_shared_typemap_traits|libmojo_core_embedder|libmojo_core_embedder_internal|libmojo_core_ports|libmojo_cpp_platform|libmojom_core_shared|libmojom_mhtml_load_result_shared|libmojom_modules_shared|libmojo_mojom_bindings|libmojo_mojom_bindings_shared|libmojom_platform_shared|libmojo_public_system|libmojo_public_system_cpp|libnative_theme|libnet|libnetwork_cpp|libnetwork_cpp_base|libnetwork_service|libnetwork_session_configurator|libonc|libos_crypt|libparsers|libpdfium|libperfetto|libperformace_manager_public_mojom|libperformace_manager_public_mojom_blink|libperformace_manager_public_mojom_shared|libplatform|libplatform_window|libplatform_window_common|libplatform_window_handler_libs|libpolicy_component|libpolicy_proto|libppapi_host|libppapi_proxy|libppapi_shared|libprefs|libprinting|libproperties|libprotobuf_lite|libproxy_config|libpublic|librange|libraster|libresource_coordinator_public_mojom|libresource_coordinator_public_mojom_blink|libresource_coordinator_public_mojom_shared|libsandbox|libsandbox_services|libscheduling_metrics|libseccomp_bpf|libsecurity_state_features|libservice|libservice_manager_cpp|libservice_manager_cpp_types|libservice_manager_mojom|libservice_manager_mojom_blink|libservice_manager_mojom_constants|libservice_manager_mojom_constants_blink|libservice_manager_mojom_constants_shared|libservice_manager_mojom_shared|libservice_manager_mojom_traits|libservice_provider|libsessions|libshared_memory_support|libshared_with_blink|libshell_dialogs|libskia|libskia_shared_typemap_traits|libsnapshot|libsql|libstartup_tracing|libstorage_browser|libstorage_common|libstorage_service_public|libstub_window|libsuid_sandbox_client|libsurface|libsystem_media_controls|libtab_count_metrics|libthread_linux|libtracing|libtracing_cpp|libtracing_mojom|libtracing_mojom_shared|libui_accessibility_ax_mojom|libui_accessibility_ax_mojom_blink|libui_accessibility_ax_mojom_shared|libui_base|libui_base_clipboard|libui_base_clipboard_types|libui_base_features|libui_base_idle|libui_base_ime|libui_base_ime_init|libui_base_ime_linux|libui_base_ime_types|libui_base_x|libui_data_pack|libui_devtools|libui_message_center_cpp|libui_touch_selection|liburl|liburl_ipc|liburl_matcher|libusb_shared|libuser_manager|libuser_prefs|libv8|libv8_libbase|libv8_libplatform|libviews|libviz_common|libviz_resource_format_utils|libviz_vulkan_context_provider|libVkICD_mock_icd|libvk_swiftshader|libvr_base|libvr_common|libvulkan_info|libvulkan_init|libvulkan_wrapper|libvulkan_x11|libvulkan_ycbcr_info|libweb_bluetooth_mojo_bindings_shared|libwebdata_common|libweb_dialogs|libweb_feature_mojo_bindings_mojom|libweb_feature_mojo_bindings_mojom_blink|libweb_feature_mojo_bindings_mojom_shared|libwebgpu|libweb_modal|libwebrtc_component|libwebview|libwm|libwm_public|libwtf|libwtf_support|libx11_events_platform|libx11_window|libzygote|libfontconfig %else @@ -221,7 +221,7 @@ Name: chromium%{chromium_channel}%{nsuffix} Name: chromium%{chromium_channel} %endif Version: %{majorversion}.0.4664.110 -Release: 5%{?dist} +Release: 6%{?dist} %if %{?freeworld} %if %{?shared} # chromium-libs-media-freeworld @@ -2121,6 +2121,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Tue Jan 4 2021 Tom Callaway - 96.0.4664.110-6 +- always filter provides, was previously inside conditional for shared builds + * Mon Jan 3 2021 Tom Callaway - 96.0.4664.110-5 - fix provides filtering to be more inclusive (and work properly) From 7a2ca72876d86540cfb11a45d1e6ae39a49804e3 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Tue, 4 Jan 2022 10:42:36 -0500 Subject: [PATCH 067/659] fix wrong years in changelog --- chromium.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chromium.spec b/chromium.spec index 1a9cd2b..c8582a9 100644 --- a/chromium.spec +++ b/chromium.spec @@ -2121,10 +2121,10 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog -* Tue Jan 4 2021 Tom Callaway - 96.0.4664.110-6 +* Tue Jan 4 2022 Tom Callaway - 96.0.4664.110-6 - always filter provides, was previously inside conditional for shared builds -* Mon Jan 3 2021 Tom Callaway - 96.0.4664.110-5 +* Mon Jan 3 2022 Tom Callaway - 96.0.4664.110-5 - fix provides filtering to be more inclusive (and work properly) * Thu Dec 30 2021 Tom Callaway - 96.0.4664.110-4 From db8833cbe813bd64bc493c4e94cd9f6c1d054fde Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Wed, 5 Jan 2022 14:36:00 -0500 Subject: [PATCH 068/659] fix regex, test build confirms provides are gone --- chromium.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/chromium.spec b/chromium.spec index c8582a9..a512a9f 100644 --- a/chromium.spec +++ b/chromium.spec @@ -106,7 +106,7 @@ # make sure there is not a trailing | at the end of the list # We always filter provides. We only filter Requires when building shared. -%global __provides_exclude_from ^(%{chromium_path}/.*\\.so*|%{chromium_path}/lib/.*\\.so|%{chromium_path}/lib/.*\\.so.*)$ +%global __provides_exclude_from ^(%{chromium_path}/.*\\.so|%{chromium_path}/.*\\.so.*|%{chromium_path}/lib/.*\\.so|%{chromium_path}/lib/.*\\.so.*)$ %if 0%{?shared} @@ -221,7 +221,7 @@ Name: chromium%{chromium_channel}%{nsuffix} Name: chromium%{chromium_channel} %endif Version: %{majorversion}.0.4664.110 -Release: 6%{?dist} +Release: 7%{?dist} %if %{?freeworld} %if %{?shared} # chromium-libs-media-freeworld @@ -2121,6 +2121,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Wed Jan 5 2022 Tom Callaway - 96.0.4664.110-7 +- i hate regex. trying again + * Tue Jan 4 2022 Tom Callaway - 96.0.4664.110-6 - always filter provides, was previously inside conditional for shared builds From 9b5d88b4c9e8706dbb9c6e3e87b030a6f6034ca4 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 19 Jan 2022 23:12:04 +0000 Subject: [PATCH 069/659] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- chromium.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chromium.spec b/chromium.spec index a512a9f..45aede6 100644 --- a/chromium.spec +++ b/chromium.spec @@ -221,7 +221,7 @@ Name: chromium%{chromium_channel}%{nsuffix} Name: chromium%{chromium_channel} %endif Version: %{majorversion}.0.4664.110 -Release: 7%{?dist} +Release: 8%{?dist} %if %{?freeworld} %if %{?shared} # chromium-libs-media-freeworld @@ -2121,6 +2121,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Wed Jan 19 2022 Fedora Release Engineering - 96.0.4664.110-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Wed Jan 5 2022 Tom Callaway - 96.0.4664.110-7 - i hate regex. trying again From 744d55e6385f71c5eb0dada308b4a9e05f68e01e Mon Sep 17 00:00:00 2001 From: Jiri Date: Sat, 5 Feb 2022 21:25:12 +0100 Subject: [PATCH 070/659] Rebuilt for java-17-openjdk as system jdk https://fedoraproject.org/wiki/Changes/Java17 --- chromium.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chromium.spec b/chromium.spec index 45aede6..82d7ad7 100644 --- a/chromium.spec +++ b/chromium.spec @@ -221,7 +221,7 @@ Name: chromium%{chromium_channel}%{nsuffix} Name: chromium%{chromium_channel} %endif Version: %{majorversion}.0.4664.110 -Release: 8%{?dist} +Release: 9%{?dist} %if %{?freeworld} %if %{?shared} # chromium-libs-media-freeworld @@ -2121,6 +2121,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Sat Feb 05 2022 Jiri Vanek - 96.0.4664.110-9 +- Rebuilt for java-17-openjdk as system jdk + * Wed Jan 19 2022 Fedora Release Engineering - 96.0.4664.110-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild From 027a6992b3012363d8dc5268e2222faddf8d4b57 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Mon, 7 Feb 2022 16:53:43 -0500 Subject: [PATCH 071/659] 98.0.4758.80 --- chromium-95-libyuv-arm.patch | 13 ++ chromium-96.0.4664.45-missing-cstring.patch | 23 --- chromium-98-MiraclePtr-gcc-ice.patch | 91 ++++++++++ chromium-98-WaylandFrameManager-check.patch | 27 +++ chromium-98.0.4758.80-EnumTable-crash.patch | 75 ++++++++ ...um-98.0.4758.80-el7-extra-operator==.patch | 15 ++ ...80-enable-hardware-accelerated-mjpeg.patch | 62 +++++++ chromium-98.0.4758.80-epel7-erase-fix.patch | 20 +++ chromium-98.0.4758.80-epel7-old-cups.patch | 167 ++++++++++++++++++ ...758.80-epel7-old-headers-workarounds.patch | 127 +++++++++++++ chromium-98.0.4758.80-fedora-user-agent.patch | 12 ++ chromium-98.0.4758.80-remoting-cstring.patch | 56 ++++++ ...4758.80-remoting-extra-qualification.patch | 84 +++++++++ chromium-browser.desktop | 2 +- chromium.spec | 83 +++++---- sources | 2 +- 16 files changed, 791 insertions(+), 68 deletions(-) create mode 100644 chromium-95-libyuv-arm.patch create mode 100644 chromium-98-MiraclePtr-gcc-ice.patch create mode 100644 chromium-98-WaylandFrameManager-check.patch create mode 100644 chromium-98.0.4758.80-EnumTable-crash.patch create mode 100644 chromium-98.0.4758.80-el7-extra-operator==.patch create mode 100644 chromium-98.0.4758.80-enable-hardware-accelerated-mjpeg.patch create mode 100644 chromium-98.0.4758.80-epel7-erase-fix.patch create mode 100644 chromium-98.0.4758.80-epel7-old-cups.patch create mode 100644 chromium-98.0.4758.80-epel7-old-headers-workarounds.patch create mode 100644 chromium-98.0.4758.80-fedora-user-agent.patch create mode 100644 chromium-98.0.4758.80-remoting-cstring.patch create mode 100644 chromium-98.0.4758.80-remoting-extra-qualification.patch diff --git a/chromium-95-libyuv-arm.patch b/chromium-95-libyuv-arm.patch new file mode 100644 index 0000000..25a8cdb --- /dev/null +++ b/chromium-95-libyuv-arm.patch @@ -0,0 +1,13 @@ +diff --git a/third_party/libyuv/source/row_neon.cc b/third_party/libyuv/source/row_neon.cc +index 6ef6f1c..e4a9e1e 100644 +--- a/third_party/libyuv/source/row_neon.cc ++++ b/third_party/libyuv/source/row_neon.cc +@@ -2346,7 +2346,7 @@ void ARGBToAB64Row_NEON(const uint8_t* src_argb, + uint16_t* dst_ab64, + int width) { + asm volatile( +- "vld1.8 q4, %3 \n" // shuffler ++ "vld1.8 {d8, d9}, %3 \n" // shuffler + "1: \n" + "vld1.8 {q0}, [%0]! \n" + "vld1.8 {q2}, [%0]! \n" diff --git a/chromium-96.0.4664.45-missing-cstring.patch b/chromium-96.0.4664.45-missing-cstring.patch index fa8580b..5a5fa2f 100644 --- a/chromium-96.0.4664.45-missing-cstring.patch +++ b/chromium-96.0.4664.45-missing-cstring.patch @@ -1,26 +1,3 @@ -diff -up chromium-96.0.4664.45/net/base/test_data_stream.cc.missing-cstring chromium-96.0.4664.45/net/base/test_data_stream.cc ---- chromium-96.0.4664.45/net/base/test_data_stream.cc.missing-cstring 2021-11-12 05:24:31.000000000 -0500 -+++ chromium-96.0.4664.45/net/base/test_data_stream.cc 2021-11-19 17:10:02.927438695 -0500 -@@ -5,6 +5,7 @@ - #include "net/base/test_data_stream.h" - - #include -+#include - - namespace net { - -diff -up chromium-96.0.4664.45/net/filter/filter_source_stream_test_util.cc.missing-cstring chromium-96.0.4664.45/net/filter/filter_source_stream_test_util.cc ---- chromium-96.0.4664.45/net/filter/filter_source_stream_test_util.cc.missing-cstring 2021-11-12 05:24:32.000000000 -0500 -+++ chromium-96.0.4664.45/net/filter/filter_source_stream_test_util.cc 2021-11-19 17:10:02.927438695 -0500 -@@ -4,6 +4,8 @@ - - #include "net/filter/filter_source_stream_test_util.h" - -+#include -+ - #include "base/bit_cast.h" - #include "base/check_op.h" - #include "third_party/zlib/zlib.h" diff -up chromium-96.0.4664.45/third_party/webrtc/audio/utility/channel_mixer.cc.missing-cstring chromium-96.0.4664.45/third_party/webrtc/audio/utility/channel_mixer.cc --- chromium-96.0.4664.45/third_party/webrtc/audio/utility/channel_mixer.cc.missing-cstring 2021-11-12 05:28:09.000000000 -0500 +++ chromium-96.0.4664.45/third_party/webrtc/audio/utility/channel_mixer.cc 2021-11-19 17:10:02.927438695 -0500 diff --git a/chromium-98-MiraclePtr-gcc-ice.patch b/chromium-98-MiraclePtr-gcc-ice.patch new file mode 100644 index 0000000..c538bef --- /dev/null +++ b/chromium-98-MiraclePtr-gcc-ice.patch @@ -0,0 +1,91 @@ +Workaround GCC ICE with MiraclePtr, see https://gcc.gnu.org/PR103455 + +--- a/gpu/command_buffer/client/gl_helper.h ++++ b/gpu/command_buffer/client/gl_helper.h +@@ -34,7 +34,7 @@ class ScopedGLuint { + GenFunc gen_func, + DeleteFunc delete_func) + : gl_(gl), id_(0u), delete_func_(delete_func) { +- (gl_->*gen_func)(1, &id_); ++ (gl_.get()->*gen_func)(1, &id_); + } + + operator GLuint() const { return id_; } +@@ -46,7 +46,7 @@ class ScopedGLuint { + + ~ScopedGLuint() { + if (id_ != 0) { +- (gl_->*delete_func_)(1, &id_); ++ (gl_.get()->*delete_func_)(1, &id_); + } + } + +@@ -86,13 +86,13 @@ class ScopedBinder { + typedef void (gles2::GLES2Interface::*BindFunc)(GLenum target, GLuint id); + ScopedBinder(gles2::GLES2Interface* gl, GLuint id, BindFunc bind_func) + : gl_(gl), bind_func_(bind_func) { +- (gl_->*bind_func_)(Target, id); ++ (gl_.get()->*bind_func_)(Target, id); + } + + ScopedBinder(const ScopedBinder&) = delete; + ScopedBinder& operator=(const ScopedBinder&) = delete; + +- virtual ~ScopedBinder() { (gl_->*bind_func_)(Target, 0); } ++ virtual ~ScopedBinder() { (gl_.get()->*bind_func_)(Target, 0); } + + private: + raw_ptr gl_; +--- a/ui/accessibility/ax_node.h ++++ b/ui/accessibility/ax_node.h +@@ -822,10 +822,10 @@ AXNode::ChildIteratorBase*LastChild)()) ++ if (child_ == (parent_.get()->*LastChild)()) + child_ = nullptr; + else +- child_ = (child_->*NextSibling)(); ++ child_ = (child_.get()->*NextSibling)(); + } + + return *this; +@@ -850,12 +850,12 @@ AXNode::ChildIteratorBase*LastChild)(); ++ child_ = (parent_.get()->*LastChild)(); + // Decrement the iterator gives us the previous element, except when the + // iterator is at the beginning; in which case, decrementing the iterator + // remains at the beginning. +- else if (child_ != (parent_->*FirstChild)()) +- child_ = (child_->*PreviousSibling)(); ++ else if (child_ != (parent_.get()->*FirstChild)()) ++ child_ = (child_.get()->*PreviousSibling)(); + } + + return *this; +--- a/ui/views/layout/flex_layout_types.cc ++++ b/ui/views/layout/flex_layout_types.cc +@@ -59,7 +59,7 @@ class LazySize { + const gfx::Size& operator*() const { return *get(); } + const gfx::Size* get() const { + if (!size_) +- size_ = (view_->*size_func_)(); ++ size_ = (view_.get()->*size_func_)(); + return &size_.value(); + } + LazyDimension width() const { +--- a/chrome/browser/ui/views/passwords/auto_signin_first_run_dialog_view.cc ++++ b/chrome/browser/ui/views/passwords/auto_signin_first_run_dialog_view.cc +@@ -37,7 +37,7 @@ AutoSigninFirstRunDialogView::AutoSigninFirstRunDialogView( + auto call_controller = [](AutoSigninFirstRunDialogView* dialog, + ControllerCallbackFn func) { + if (dialog->controller_) { +- (dialog->controller_->*func)(); ++ (dialog->controller_.get()->*func)(); + } + }; + SetAcceptCallback( diff --git a/chromium-98-WaylandFrameManager-check.patch b/chromium-98-WaylandFrameManager-check.patch new file mode 100644 index 0000000..dc8b06b --- /dev/null +++ b/chromium-98-WaylandFrameManager-check.patch @@ -0,0 +1,27 @@ +From 8e2458ffc6727943518a622753b074b42e713403 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Sat, 18 Dec 2021 08:38:57 +0000 +Subject: [PATCH] libstdc++: fix DCHECK_NE in ui::WaylandFrameManager + +There is no CheckOpValueStr() for std::unique_ptr. Use get() to +compare pointer values. +--- + ui/ozone/platform/wayland/host/wayland_frame_manager.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ui/ozone/platform/wayland/host/wayland_frame_manager.cc b/ui/ozone/platform/wayland/host/wayland_frame_manager.cc +index 569526c..58fae14 100644 +--- a/ui/ozone/platform/wayland/host/wayland_frame_manager.cc ++++ b/ui/ozone/platform/wayland/host/wayland_frame_manager.cc +@@ -379,7 +379,7 @@ void WaylandFrameManager::OnPresentation( + // Investigate the issue with surface sync. + frame->feedback = gfx::PresentationFeedback::Failure(); + } +- CHECK_NE(frame, submitted_frames_.back()); ++ CHECK_NE(frame.get(), submitted_frames_.back().get()); + } + MaybeProcessSubmittedFrames(); + } +-- +2.32.0 + diff --git a/chromium-98.0.4758.80-EnumTable-crash.patch b/chromium-98.0.4758.80-EnumTable-crash.patch new file mode 100644 index 0000000..68459ba --- /dev/null +++ b/chromium-98.0.4758.80-EnumTable-crash.patch @@ -0,0 +1,75 @@ +diff -up chromium-98.0.4758.80/components/cast_channel/enum_table.h.EnumTable-crash chromium-98.0.4758.80/components/cast_channel/enum_table.h +--- chromium-98.0.4758.80/components/cast_channel/enum_table.h.EnumTable-crash 2022-02-01 00:41:47.000000000 +0000 ++++ chromium-98.0.4758.80/components/cast_channel/enum_table.h 2022-02-02 18:54:23.096214186 +0000 +@@ -8,6 +8,7 @@ + #include + #include + #include ++#include + + #include "base/check_op.h" + #include "base/notreached.h" +@@ -187,7 +188,6 @@ class + inline constexpr GenericEnumTableEntry(int32_t value); + inline constexpr GenericEnumTableEntry(int32_t value, base::StringPiece str); + +- GenericEnumTableEntry(const GenericEnumTableEntry&) = delete; + GenericEnumTableEntry& operator=(const GenericEnumTableEntry&) = delete; + + private: +@@ -253,7 +253,6 @@ class EnumTable { + constexpr Entry(E value, base::StringPiece str) + : GenericEnumTableEntry(static_cast(value), str) {} + +- Entry(const Entry&) = delete; + Entry& operator=(const Entry&) = delete; + }; + +@@ -312,15 +311,14 @@ class EnumTable { + if (is_sorted_) { + const std::size_t index = static_cast(value); + if (ANALYZER_ASSUME_TRUE(index < data_.size())) { +- const auto& entry = data_.begin()[index]; ++ const auto& entry = data_[index]; + if (ANALYZER_ASSUME_TRUE(entry.has_str())) + return entry.str(); + } + return absl::nullopt; + } + return GenericEnumTableEntry::FindByValue( +- reinterpret_cast(data_.begin()), +- data_.size(), static_cast(value)); ++ &data_[0], data_.size(), static_cast(value)); + } + + // This overload of GetString is designed for cases where the argument is a +@@ -348,8 +346,7 @@ class EnumTable { + // enum value directly. + absl::optional GetEnum(base::StringPiece str) const { + auto* entry = GenericEnumTableEntry::FindByString( +- reinterpret_cast(data_.begin()), +- data_.size(), str); ++ &data_[0], data_.size(), str); + return entry ? static_cast(entry->value) : absl::optional(); + } + +@@ -364,7 +361,7 @@ class EnumTable { + // Align the data on a cache line boundary. + alignas(64) + #endif +- std::initializer_list data_; ++ const std::vector data_; + bool is_sorted_; + + constexpr EnumTable(std::initializer_list data, bool is_sorted) +@@ -376,8 +373,8 @@ class EnumTable { + + for (std::size_t i = 0; i < data.size(); i++) { + for (std::size_t j = i + 1; j < data.size(); j++) { +- const Entry& ei = data.begin()[i]; +- const Entry& ej = data.begin()[j]; ++ const Entry& ei = data[i]; ++ const Entry& ej = data[j]; + DCHECK(ei.value != ej.value) + << "Found duplicate enum values at indices " << i << " and " << j; + DCHECK(!(ei.has_str() && ej.has_str() && ei.str() == ej.str())) diff --git a/chromium-98.0.4758.80-el7-extra-operator==.patch b/chromium-98.0.4758.80-el7-extra-operator==.patch new file mode 100644 index 0000000..a6c37a8 --- /dev/null +++ b/chromium-98.0.4758.80-el7-extra-operator==.patch @@ -0,0 +1,15 @@ +diff -up chromium-98.0.4758.80/base/allocator/partition_allocator/starscan/metadata_allocator.h.wtf chromium-98.0.4758.80/base/allocator/partition_allocator/starscan/metadata_allocator.h +--- chromium-98.0.4758.80/base/allocator/partition_allocator/starscan/metadata_allocator.h.wtf 2022-02-05 16:05:15.125570250 +0000 ++++ chromium-98.0.4758.80/base/allocator/partition_allocator/starscan/metadata_allocator.h 2022-02-05 16:11:45.519670294 +0000 +@@ -39,6 +39,11 @@ class MetadataAllocator { + } + + template ++ bool operator==(const MetadataAllocator&) const { ++ return true; ++ } ++ ++ template + bool operator!=(const MetadataAllocator& o) { + return !operator==(o); + } diff --git a/chromium-98.0.4758.80-enable-hardware-accelerated-mjpeg.patch b/chromium-98.0.4758.80-enable-hardware-accelerated-mjpeg.patch new file mode 100644 index 0000000..71e28c1 --- /dev/null +++ b/chromium-98.0.4758.80-enable-hardware-accelerated-mjpeg.patch @@ -0,0 +1,62 @@ +diff -up chromium-98.0.4758.80/chrome/browser/about_flags.cc.accel-mjpeg chromium-98.0.4758.80/chrome/browser/about_flags.cc +--- chromium-98.0.4758.80/chrome/browser/about_flags.cc.accel-mjpeg 2022-02-01 00:41:40.000000000 +0000 ++++ chromium-98.0.4758.80/chrome/browser/about_flags.cc 2022-02-02 19:23:15.554137616 +0000 +@@ -3822,12 +3822,12 @@ const FeatureEntry kFeatureEntries[] = { + flag_descriptions::kWebXrForceRuntimeDescription, kOsDesktop, + MULTI_VALUE_TYPE(kWebXrForceRuntimeChoices)}, + #endif // ENABLE_VR +-#if BUILDFLAG(IS_CHROMEOS_ASH) ++#if BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_LINUX) + {"disable-accelerated-mjpeg-decode", + flag_descriptions::kAcceleratedMjpegDecodeName, +- flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsCrOS, ++ flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsCrOS | kOsLinux, + SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedMjpegDecode)}, +-#endif // BUILDFLAG(IS_CHROMEOS_ASH) ++#endif // BUILDFLAG(IS_CHROMEOS_ASH) || OS_LINUX + {"system-keyboard-lock", flag_descriptions::kSystemKeyboardLockName, + flag_descriptions::kSystemKeyboardLockDescription, kOsDesktop, + FEATURE_VALUE_TYPE(features::kSystemKeyboardLock)}, +diff -up chromium-98.0.4758.80/chrome/browser/flag_descriptions.cc.accel-mjpeg chromium-98.0.4758.80/chrome/browser/flag_descriptions.cc +--- chromium-98.0.4758.80/chrome/browser/flag_descriptions.cc.accel-mjpeg 2022-02-02 19:23:15.555137569 +0000 ++++ chromium-98.0.4758.80/chrome/browser/flag_descriptions.cc 2022-02-02 19:30:58.315465225 +0000 +@@ -3979,7 +3979,7 @@ const char kUseAngleGL[] = "OpenGL"; + + // Chrome OS ------------------------------------------------------------------- + +-#if BUILDFLAG(IS_CHROMEOS_ASH) ++#if BUILDFLAG(IS_CHROMEOS_ASH) || (defined(OS_LINUX) && !defined(OS_ANDROID)) + + const char kAcceleratedMjpegDecodeName[] = + "Hardware-accelerated mjpeg decode for captured frame"; +@@ -3987,6 +3987,10 @@ const char kAcceleratedMjpegDecodeDescri + "Enable hardware-accelerated mjpeg decode for captured frame where " + "available."; + ++#endif ++ ++#if BUILDFLAG(IS_CHROMEOS_ASH) ++ + const char kAllowDisableMouseAccelerationName[] = + "Allow disabling mouse acceleration"; + const char kAllowDisableMouseAccelerationDescription[] = +diff -up chromium-98.0.4758.80/chrome/browser/flag_descriptions.h.accel-mjpeg chromium-98.0.4758.80/chrome/browser/flag_descriptions.h +--- chromium-98.0.4758.80/chrome/browser/flag_descriptions.h.accel-mjpeg 2022-02-02 19:23:15.556137523 +0000 ++++ chromium-98.0.4758.80/chrome/browser/flag_descriptions.h 2022-02-02 19:31:59.585595773 +0000 +@@ -2297,11 +2297,15 @@ extern const char kUseAngleGL[]; + + // Chrome OS ------------------------------------------------------------------ + +-#if BUILDFLAG(IS_CHROMEOS_ASH) ++#if BUILDFLAG(IS_CHROMEOS_ASH) || (defined(OS_LINUX) && !defined(OS_ANDROID)) + + extern const char kAcceleratedMjpegDecodeName[]; + extern const char kAcceleratedMjpegDecodeDescription[]; + ++#endif ++ ++#if BUILDFLAG(IS_CHROMEOS_ASH) ++ + extern const char kAllowDisableMouseAccelerationName[]; + extern const char kAllowDisableMouseAccelerationDescription[]; + diff --git a/chromium-98.0.4758.80-epel7-erase-fix.patch b/chromium-98.0.4758.80-epel7-erase-fix.patch new file mode 100644 index 0000000..230e9d6 --- /dev/null +++ b/chromium-98.0.4758.80-epel7-erase-fix.patch @@ -0,0 +1,20 @@ +diff -up chromium-98.0.4758.80/components/ui_devtools/views/ui_element_with_metadata.cc.erase-fix chromium-98.0.4758.80/components/ui_devtools/views/ui_element_with_metadata.cc +--- chromium-98.0.4758.80/components/ui_devtools/views/ui_element_with_metadata.cc.erase-fix 2022-02-03 19:16:57.784979831 +0000 ++++ chromium-98.0.4758.80/components/ui_devtools/views/ui_element_with_metadata.cc 2022-02-03 19:17:12.983633352 +0000 +@@ -19,14 +19,14 @@ namespace { + // Remove any custom editor "prefixes" from the property name. The prefixes must + // not be valid identifier characters. + void StripPrefix(std::string& property_name) { +- auto cur = property_name.cbegin(); ++ auto cur = property_name.begin(); + for (; cur < property_name.cend(); ++cur) { + if ((*cur >= 'A' && *cur <= 'Z') || (*cur >= 'a' && *cur <= 'z') || + *cur == '_') { + break; + } + } +- property_name.erase(property_name.cbegin(), cur); ++ property_name.erase(property_name.begin(), cur); + } + + } // namespace diff --git a/chromium-98.0.4758.80-epel7-old-cups.patch b/chromium-98.0.4758.80-epel7-old-cups.patch new file mode 100644 index 0000000..8ed30b7 --- /dev/null +++ b/chromium-98.0.4758.80-epel7-old-cups.patch @@ -0,0 +1,167 @@ +diff -up chromium-98.0.4758.80/chrome/service/cloud_print/print_system_cups.cc.el7cups chromium-98.0.4758.80/chrome/service/cloud_print/print_system_cups.cc +--- chromium-98.0.4758.80/chrome/service/cloud_print/print_system_cups.cc.el7cups 2022-02-05 16:24:50.301779674 +0000 ++++ chromium-98.0.4758.80/chrome/service/cloud_print/print_system_cups.cc 2022-02-05 16:24:50.302779651 +0000 +@@ -729,8 +729,9 @@ int PrintSystemCUPS::PrintFile(const GUR + // Use default (local) print server. + if (url.is_empty()) + return cupsPrintFile(name, filename, title, num_options, options); +- +- printing::HttpConnectionCUPS http(url, encryption, /*blocking=*/false); ++ ++ printing::HttpConnectionCUPS http(url, encryption); ++ http.SetBlocking(false); + return cupsPrintFile2(http.http(), name, filename, title, num_options, + options); + } +@@ -746,7 +747,8 @@ int PrintSystemCUPS::GetJobs(cups_job_t* + if (url.is_empty()) + return cupsGetJobs(jobs, name, myjobs, whichjobs); + +- printing::HttpConnectionCUPS http(url, encryption, /*blocking=*/false); ++ printing::HttpConnectionCUPS http(url, encryption); ++ http.SetBlocking(false); + return cupsGetJobs2(http.http(), jobs, name, myjobs, whichjobs); + } + +diff -up chromium-98.0.4758.80/printing/backend/cups_helper.cc.el7cups chromium-98.0.4758.80/printing/backend/cups_helper.cc +--- chromium-98.0.4758.80/printing/backend/cups_helper.cc.el7cups 2022-02-05 16:25:16.885173676 +0000 ++++ chromium-98.0.4758.80/printing/backend/cups_helper.cc 2022-02-05 16:25:16.886173653 +0000 +@@ -34,18 +34,6 @@ namespace printing { + // This section contains helper code for PPD parsing for semantic capabilities. + namespace { + +-// Function availability can be tested by checking whether its address is not +-// nullptr. Weak symbols remove the need for platform specific build flags and +-// allow for appropriate CUPS usage on platforms with non-uniform version +-// support, namely Linux. +-#define WEAK_CUPS_FN(x) extern "C" __attribute__((weak)) decltype(x) x +- +-WEAK_CUPS_FN(httpConnect2); +- +-// Timeout for establishing a CUPS connection. It is expected that cupsd is +-// able to start and respond on all systems within this duration. +-constexpr base::TimeDelta kCupsTimeout = base::Seconds(5); +- + // CUPS default max copies value (parsed from kCupsMaxCopies PPD attribute). + constexpr int32_t kDefaultMaxCopies = 9999; + constexpr char kCupsMaxCopies[] = "cupsMaxCopies"; +@@ -527,8 +515,7 @@ const int kDefaultIPPServerPort = 631; + // Helper wrapper around http_t structure, with connection and cleanup + // functionality. + HttpConnectionCUPS::HttpConnectionCUPS(const GURL& print_server_url, +- http_encryption_t encryption, +- bool blocking) ++ http_encryption_t encryption) + : http_(nullptr) { + // If we have an empty url, use default print server. + if (print_server_url.is_empty()) +@@ -538,17 +525,10 @@ HttpConnectionCUPS::HttpConnectionCUPS(c + if (port == url::PORT_UNSPECIFIED) + port = kDefaultIPPServerPort; + +- if (httpConnect2) { +- http_ = httpConnect2(print_server_url.host().c_str(), port, +- /*addrlist=*/nullptr, AF_UNSPEC, encryption, +- blocking ? 1 : 0, kCupsTimeout.InMilliseconds(), +- /*cancel=*/nullptr); +- } else { +- // Continue to use deprecated CUPS calls because because older Linux +- // distribution such as RHEL/CentOS 7 are shipped with CUPS 1.6. +- http_ = +- httpConnectEncrypt(print_server_url.host().c_str(), port, encryption); +- } ++ // Continue to use deprecated CUPS calls because because older Linux ++ // distribution such as RHEL/CentOS 7 are shipped with CUPS 1.6. ++ http_ = ++ httpConnectEncrypt(print_server_url.host().c_str(), port, encryption); + + if (!http_) { + LOG(ERROR) << "CP_CUPS: Failed connecting to print server: " +@@ -556,8 +536,6 @@ HttpConnectionCUPS::HttpConnectionCUPS(c + return; + } + +- if (!httpConnect2) +- httpBlocking(http_, blocking ? 1 : 0); + } + + HttpConnectionCUPS::~HttpConnectionCUPS() { +@@ -565,6 +543,10 @@ HttpConnectionCUPS::~HttpConnectionCUPS( + httpClose(http_); + } + ++void HttpConnectionCUPS::SetBlocking(bool blocking) { ++ httpBlocking(http_, blocking ? 1 : 0); ++} ++ + http_t* HttpConnectionCUPS::http() { + return http_; + } +diff -up chromium-98.0.4758.80/printing/backend/cups_helper.h.el7cups chromium-98.0.4758.80/printing/backend/cups_helper.h +--- chromium-98.0.4758.80/printing/backend/cups_helper.h.el7cups 2022-02-05 16:25:16.886173653 +0000 ++++ chromium-98.0.4758.80/printing/backend/cups_helper.h 2022-02-05 16:25:16.886173653 +0000 +@@ -34,10 +34,11 @@ constexpr cups_ptype_t kDestinationsFilt + class COMPONENT_EXPORT(PRINT_BACKEND) HttpConnectionCUPS { + public: + HttpConnectionCUPS(const GURL& print_server_url, +- http_encryption_t encryption, +- bool blocking); ++ http_encryption_t encryption); + ~HttpConnectionCUPS(); + ++ void SetBlocking(bool blocking); ++ + http_t* http(); + + private: +diff -up chromium-98.0.4758.80/printing/backend/print_backend_cups.cc.el7cups chromium-98.0.4758.80/printing/backend/print_backend_cups.cc +--- chromium-98.0.4758.80/printing/backend/print_backend_cups.cc.el7cups 2022-02-05 16:25:16.887173630 +0000 ++++ chromium-98.0.4758.80/printing/backend/print_backend_cups.cc 2022-02-07 00:23:16.315248327 +0000 +@@ -146,7 +146,7 @@ mojom::ResultCode PrintBackendCUPS::Enum + // not showing as available. Using cupsEnumDests() allows us to do our own + // filtering should any duplicates occur. + CupsDestsData dests_data = {0, nullptr}; +- ipp_status_t last_error = IPP_STATUS_OK; ++ ipp_status_t last_error = IPP_OK; + if (print_server_url_.is_empty()) { + VLOG(1) << "CUPS: using cupsEnumDests to enumerate printers"; + if (!cupsEnumDests(CUPS_DEST_FLAGS_NONE, kCupsTimeoutMs, +@@ -173,7 +173,7 @@ mojom::ResultCode PrintBackendCUPS::Enum + // no printer drivers installed. Rely upon CUPS error code to distinguish + // between these. + DCHECK(!dests_data.dests); +- if (last_error != IPP_STATUS_ERROR_NOT_FOUND) { ++ if (last_error != IPP_NOT_FOUND) { + VLOG(1) << "CUPS: Error getting printers from CUPS server" + << ", server: " << print_server_url_ + << ", error: " << static_cast(last_error) << " - " +@@ -336,7 +336,8 @@ int PrintBackendCUPS::GetDests(cups_dest + if (print_server_url_.is_empty()) + return cupsGetDests2(CUPS_HTTP_DEFAULT, dests); + +- HttpConnectionCUPS http(print_server_url_, cups_encryption_, blocking_); ++ HttpConnectionCUPS http(print_server_url_, cups_encryption_); ++ http.SetBlocking(blocking_); + + // This call must be made in the same scope as `http` because its destructor + // closes the connection. +@@ -362,7 +363,8 @@ base::FilePath PrintBackendCUPS::GetPPD( + // connection will timeout after 10 seconds of no data period. And it will + // return the same way as if data was completely and successfully + // downloaded. +- HttpConnectionCUPS http(print_server_url_, cups_encryption_, blocking_); ++ HttpConnectionCUPS http(print_server_url_, cups_encryption_); ++ http.SetBlocking(blocking_); + ppd_file_path = cupsGetPPD2(http.http(), name); + // Check if the get full PPD, since non-blocking call may simply return + // normally after timeout expired. +@@ -398,7 +400,8 @@ PrintBackendCUPS::ScopedDestination Prin + // Use default (local) print server. + dest = cupsGetNamedDest(CUPS_HTTP_DEFAULT, printer_name.c_str(), nullptr); + } else { +- HttpConnectionCUPS http(print_server_url_, cups_encryption_, blocking_); ++ HttpConnectionCUPS http(print_server_url_, cups_encryption_); ++ http.SetBlocking(blocking_); + dest = cupsGetNamedDest(http.http(), printer_name.c_str(), nullptr); + } + return ScopedDestination(dest); diff --git a/chromium-98.0.4758.80-epel7-old-headers-workarounds.patch b/chromium-98.0.4758.80-epel7-old-headers-workarounds.patch new file mode 100644 index 0000000..325ba15 --- /dev/null +++ b/chromium-98.0.4758.80-epel7-old-headers-workarounds.patch @@ -0,0 +1,127 @@ +diff -up chromium-98.0.4758.80/mojo/core/channel_linux.cc.epel7-header-workarounds chromium-98.0.4758.80/mojo/core/channel_linux.cc +--- chromium-98.0.4758.80/mojo/core/channel_linux.cc.epel7-header-workarounds 2022-02-03 18:37:49.535504412 +0000 ++++ chromium-98.0.4758.80/mojo/core/channel_linux.cc 2022-02-03 18:55:08.833815527 +0000 +@@ -44,6 +44,25 @@ + #include "base/android/build_info.h" + #endif + ++#ifndef F_LINUX_SPECIFIC_BASE ++#define F_LINUX_SPECIFIC_BASE 1024 ++#endif ++#ifndef F_SEAL_SEAL ++#define F_SEAL_SEAL 0x0001 ++#endif ++#ifndef F_SEAL_SHRINK ++#define F_SEAL_SHRINK 0x0002 ++#endif ++#ifndef F_SEAL_GROW ++#define F_SEAL_GROW 0x0004 ++#endif ++#ifndef F_ADD_SEALS ++#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9) ++#endif ++#ifndef F_GET_SEALS ++#define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10) ++#endif ++ + #ifndef EFD_ZERO_ON_WAKE + #define EFD_ZERO_ON_WAKE O_NOFOLLOW + #endif +diff -up chromium-98.0.4758.80/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc.epel7-header-workarounds chromium-98.0.4758.80/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc +--- chromium-98.0.4758.80/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc.epel7-header-workarounds 2022-02-01 00:41:54.000000000 +0000 ++++ chromium-98.0.4758.80/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc 2022-02-03 18:37:49.536504389 +0000 +@@ -53,6 +53,25 @@ + + #endif // defined(OS_ANDROID) + ++#ifndef F_LINUX_SPECIFIC_BASE ++#define F_LINUX_SPECIFIC_BASE 1024 ++#endif ++#ifndef F_SEAL_SEAL ++#define F_SEAL_SEAL 0x0001 ++#endif ++#ifndef F_SEAL_SHRINK ++#define F_SEAL_SHRINK 0x0002 ++#endif ++#ifndef F_SEAL_GROW ++#define F_SEAL_GROW 0x0004 ++#endif ++#ifndef F_ADD_SEALS ++#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9) ++#endif ++#ifndef F_GET_SEALS ++#define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10) ++#endif ++ + #if defined(__arm__) && !defined(MAP_STACK) + #define MAP_STACK 0x20000 // Daisy build environment has old headers. + #endif +diff -up chromium-98.0.4758.80/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc.epel7-header-workarounds chromium-98.0.4758.80/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc +--- chromium-98.0.4758.80/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc.epel7-header-workarounds 2022-02-01 00:41:54.000000000 +0000 ++++ chromium-98.0.4758.80/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc 2022-02-03 18:37:49.535504412 +0000 +@@ -6,7 +6,24 @@ + + #include + #include +-#include ++#ifndef KCMP_FILE ++#define KCMP_FILE 0 ++#endif ++#ifndef F_LINUX_SPECIFIC_BASE ++#define F_LINUX_SPECIFIC_BASE 1024 ++#endif ++#ifndef F_SEAL_SEAL ++#define F_SEAL_SEAL 0x0001 ++#endif ++#ifndef F_SEAL_SHRINK ++#define F_SEAL_SHRINK 0x0002 ++#endif ++#ifndef F_SEAL_GROW ++#define F_SEAL_GROW 0x0004 ++#endif ++#ifndef F_ADD_SEALS ++#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9) ++#endif + #include + + // Some arch's (arm64 for instance) unistd.h don't pull in symbols used here +diff -up chromium-98.0.4758.80/sandbox/policy/linux/bpf_gpu_policy_linux.cc.epel7-header-workarounds chromium-98.0.4758.80/sandbox/policy/linux/bpf_gpu_policy_linux.cc +--- chromium-98.0.4758.80/sandbox/policy/linux/bpf_gpu_policy_linux.cc.epel7-header-workarounds 2022-02-03 18:37:49.535504412 +0000 ++++ chromium-98.0.4758.80/sandbox/policy/linux/bpf_gpu_policy_linux.cc 2022-02-03 18:56:24.382093563 +0000 +@@ -22,6 +22,22 @@ + #include "sandbox/policy/linux/sandbox_linux.h" + #include "sandbox/policy/linux/sandbox_seccomp_bpf_linux.h" + ++#ifndef F_LINUX_SPECIFIC_BASE ++#define F_LINUX_SPECIFIC_BASE 1024 ++#endif ++#ifndef F_SEAL_SEAL ++#define F_SEAL_SEAL 0x0001 ++#endif ++#ifndef F_SEAL_SHRINK ++#define F_SEAL_SHRINK 0x0002 ++#endif ++#ifndef F_SEAL_GROW ++#define F_SEAL_GROW 0x0004 ++#endif ++#ifndef F_ADD_SEALS ++#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9) ++#endif ++ + using sandbox::bpf_dsl::AllOf; + using sandbox::bpf_dsl::Allow; + using sandbox::bpf_dsl::Arg; +diff -up chromium-98.0.4758.80/ui/events/ozone/evdev/event_converter_evdev_impl.cc.epel7-header-workarounds chromium-98.0.4758.80/ui/events/ozone/evdev/event_converter_evdev_impl.cc +--- chromium-98.0.4758.80/ui/events/ozone/evdev/event_converter_evdev_impl.cc.epel7-header-workarounds 2022-02-03 18:37:49.536504389 +0000 ++++ chromium-98.0.4758.80/ui/events/ozone/evdev/event_converter_evdev_impl.cc 2022-02-03 18:57:16.842897816 +0000 +@@ -23,6 +23,10 @@ + #include "ui/events/ozone/evdev/numberpad_metrics.h" + #endif + ++#ifndef SW_PEN_INSERTED ++#define SW_PEN_INSERTED 0x0f /* set = pen inserted */ ++#endif ++ + namespace ui { + + namespace { diff --git a/chromium-98.0.4758.80-fedora-user-agent.patch b/chromium-98.0.4758.80-fedora-user-agent.patch new file mode 100644 index 0000000..84dddf2 --- /dev/null +++ b/chromium-98.0.4758.80-fedora-user-agent.patch @@ -0,0 +1,12 @@ +diff -up chromium-98.0.4758.80/content/common/user_agent.cc.fedora-user-agent chromium-98.0.4758.80/content/common/user_agent.cc +--- chromium-98.0.4758.80/content/common/user_agent.cc.fedora-user-agent 2022-02-02 19:16:37.841755606 +0000 ++++ chromium-98.0.4758.80/content/common/user_agent.cc 2022-02-02 19:19:52.395650550 +0000 +@@ -34,7 +34,7 @@ std::string GetUserAgentPlatform() { + #elif defined(OS_MAC) + return "Macintosh; "; + #elif defined(USE_OZONE) +- return "X11; "; // strange, but that's what Firefox uses ++ return "X11; Fedora; "; // strange, but that's what Firefox uses + #elif defined(OS_ANDROID) + return "Linux; "; + #elif defined(OS_FUCHSIA) diff --git a/chromium-98.0.4758.80-remoting-cstring.patch b/chromium-98.0.4758.80-remoting-cstring.patch new file mode 100644 index 0000000..5c96921 --- /dev/null +++ b/chromium-98.0.4758.80-remoting-cstring.patch @@ -0,0 +1,56 @@ +diff -up chromium-98.0.4758.80/remoting/base/util.cc.remoting-cstring chromium-98.0.4758.80/remoting/base/util.cc +--- chromium-98.0.4758.80/remoting/base/util.cc.remoting-cstring 2022-02-01 00:41:54.000000000 +0000 ++++ chromium-98.0.4758.80/remoting/base/util.cc 2022-02-02 15:55:01.352340901 +0000 +@@ -4,6 +4,7 @@ + + #include "remoting/base/util.h" + ++#include + #include + + #include "base/logging.h" +diff -up chromium-98.0.4758.80/remoting/client/display/gl_helpers.cc.remoting-cstring chromium-98.0.4758.80/remoting/client/display/gl_helpers.cc +--- chromium-98.0.4758.80/remoting/client/display/gl_helpers.cc.remoting-cstring 2022-02-01 00:41:54.000000000 +0000 ++++ chromium-98.0.4758.80/remoting/client/display/gl_helpers.cc 2022-02-02 15:55:01.353340854 +0000 +@@ -5,6 +5,7 @@ + #include "remoting/client/display/gl_helpers.h" + + #include "base/logging.h" ++#include + + namespace remoting { + +diff -up chromium-98.0.4758.80/remoting/host/fake_mouse_cursor_monitor.cc.remoting-cstring chromium-98.0.4758.80/remoting/host/fake_mouse_cursor_monitor.cc +--- chromium-98.0.4758.80/remoting/host/fake_mouse_cursor_monitor.cc.remoting-cstring 2022-02-01 00:41:54.000000000 +0000 ++++ chromium-98.0.4758.80/remoting/host/fake_mouse_cursor_monitor.cc 2022-02-02 15:55:01.353340854 +0000 +@@ -4,6 +4,7 @@ + + #include "remoting/host/fake_mouse_cursor_monitor.h" + ++#include + #include + + #include "base/check.h" +diff -up chromium-98.0.4758.80/remoting/host/host_config_unittest.cc.remoting-cstring chromium-98.0.4758.80/remoting/host/host_config_unittest.cc +--- chromium-98.0.4758.80/remoting/host/host_config_unittest.cc.remoting-cstring 2022-02-02 15:55:01.353340854 +0000 ++++ chromium-98.0.4758.80/remoting/host/host_config_unittest.cc 2022-02-02 15:57:20.295794172 +0000 +@@ -10,6 +10,7 @@ + #include "base/values.h" + #include "testing/gtest/include/gtest/gtest.h" + #include "third_party/abseil-cpp/absl/types/optional.h" ++#include + + namespace remoting { + +diff -up chromium-98.0.4758.80/remoting/host/host_secret.cc.remoting-cstring chromium-98.0.4758.80/remoting/host/host_secret.cc +--- chromium-98.0.4758.80/remoting/host/host_secret.cc.remoting-cstring 2022-02-01 00:41:54.000000000 +0000 ++++ chromium-98.0.4758.80/remoting/host/host_secret.cc 2022-02-02 15:55:01.353340854 +0000 +@@ -6,7 +6,7 @@ + + #include + +-#include ++#include + + #include "base/rand_util.h" + #include "base/strings/string_number_conversions.h" diff --git a/chromium-98.0.4758.80-remoting-extra-qualification.patch b/chromium-98.0.4758.80-remoting-extra-qualification.patch new file mode 100644 index 0000000..013fdc9 --- /dev/null +++ b/chromium-98.0.4758.80-remoting-extra-qualification.patch @@ -0,0 +1,84 @@ +diff -up chromium-98.0.4758.80/remoting/host/mojom/remoting_mojom_traits.h.extra-qualification chromium-98.0.4758.80/remoting/host/mojom/remoting_mojom_traits.h +--- chromium-98.0.4758.80/remoting/host/mojom/remoting_mojom_traits.h.extra-qualification 2022-02-04 00:55:00.643766557 +0000 ++++ chromium-98.0.4758.80/remoting/host/mojom/remoting_mojom_traits.h 2022-02-04 00:56:18.272148934 +0000 +@@ -21,7 +21,7 @@ + namespace mojo { + + template <> +-class mojo::StructTraits { ++class StructTraits { + public: + static bool value(bool value) { return value; } + +@@ -32,7 +32,7 @@ class mojo::StructTraits +-class mojo::StructTraits { ++class StructTraits { + public: + static float value(float value) { return value; } + +@@ -43,7 +43,7 @@ class mojo::StructTraits +-class mojo::StructTraits { ++class StructTraits { + public: + static int32_t value(int32_t value) { return value; } + +@@ -109,7 +109,7 @@ struct EnumTraits +-class mojo::StructTraits { + public: + static const std::string& mime_type( +@@ -127,7 +127,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static bool pressed(const ::remoting::protocol::KeyEvent& event) { +@@ -163,7 +163,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static absl::optional x( +@@ -252,7 +252,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static const std::string& text(const ::remoting::protocol::TextEvent& event) { +@@ -264,7 +264,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static uint32_t id(const ::remoting::protocol::TouchEventPoint& event) { +@@ -341,7 +341,7 @@ struct EnumTraits +-class mojo::StructTraits { + public: + static ::remoting::protocol::TouchEvent::TouchEventType event_type( diff --git a/chromium-browser.desktop b/chromium-browser.desktop index 962decb..23d3257 100644 --- a/chromium-browser.desktop +++ b/chromium-browser.desktop @@ -134,7 +134,7 @@ X-MultipleArgs=false Type=Application Icon=chromium-browser Categories=Network;WebBrowser; -MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp; +MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https; StartupWMClass=Chromium-browser Keywords=web;browser;internet; Actions=new-window;new-private-window; diff --git a/chromium.spec b/chromium.spec index a512a9f..8ca7b9f 100644 --- a/chromium.spec +++ b/chromium.spec @@ -155,7 +155,7 @@ BuildRequires: libicu-devel >= 5.4 %global gtk3 1 %if 0%{?rhel} == 7 || 0%{?rhel} == 8 -%global dts_version 9 +%global dts_version 11 %global bundleopus 1 %global bundlelibusbx 1 @@ -213,15 +213,15 @@ BuildRequires: libicu-devel >= 5.4 %global chromoting_client_id %nil %endif -%global majorversion 96 +%global majorversion 98 %if %{freeworld} Name: chromium%{chromium_channel}%{nsuffix} %else Name: chromium%{chromium_channel} %endif -Version: %{majorversion}.0.4664.110 -Release: 7%{?dist} +Version: %{majorversion}.0.4758.80 +Release: 1%{?dist} %if %{?freeworld} %if %{?shared} # chromium-libs-media-freeworld @@ -264,7 +264,7 @@ Patch11: chromium-93.0.4577.63-py3-bootstrap.patch Patch11: chromium-92.0.4515.107-py2-bootstrap.patch %endif # Add "Fedora" to the user agent string -Patch12: chromium-86.0.4240.75-fedora-user-agent.patch +Patch12: chromium-98.0.4758.80-fedora-user-agent.patch # Needs to be submitted.. Patch51: chromium-96.0.4664.45-gcc-remoting-constexpr.patch @@ -279,33 +279,22 @@ Patch57: chromium-96.0.4664.45-missing-cstring.patch # prepare for using system ffmpeg (clean) # http://svnweb.mageia.org/packages/cauldron/chromium-browser-stable/current/SOURCES/chromium-53-ffmpeg-no-deprecation-errors.patch?view=markup Patch58: chromium-53-ffmpeg-no-deprecation-errors.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-96-CouponDB-include.patch -Patch59: chromium-96-CouponDB-include.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-95-libyuv-aarch64.patch -Patch60: chromium-95-libyuv-aarch64.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-96-CommandLine-include.patch -Patch61: chromium-96-CommandLine-include.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-96-RestrictedCookieManager-tuple.patch -Patch62: chromium-96-RestrictedCookieManager-tuple.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-96-DrmRenderNodePathFinder-include.patch -Patch63: chromium-96-DrmRenderNodePathFinder-include.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-95-libyuv-arm.patch +Patch60: chromium-95-libyuv-arm.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-98-MiraclePtr-gcc-ice.patch +Patch61: chromium-98-MiraclePtr-gcc-ice.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-98-WaylandFrameManager-check.patch +Patch62: chromium-98-WaylandFrameManager-check.patch # Extra CXXFLAGS for aarch64 Patch64: chromium-91.0.4472.77-aarch64-cxxflags-addition.patch # Fix issue where closure_compiler thinks java is only allowed in android builds # https://bugs.chromium.org/p/chromium/issues/detail?id=1192875 Patch65: chromium-91.0.4472.77-java-only-allowed-in-android-builds.patch -# Silence GCC warnings during gn compile -Patch66: chromium-92.0.4515.107-gn-gcc-cleanup.patch # Fix missing cstring in remoting code -Patch67: chromium-84.0.4147.125-remoting-cstring.patch +Patch67: chromium-98.0.4758.80-remoting-cstring.patch # Apply fix_textrels hack for i686 (even without lld) Patch68: chromium-84.0.4147.125-i686-fix_textrels.patch -# Work around binutils bug in aarch64 (F33+) -Patch69: chromium-84.0.4147.125-aarch64-clearkeycdm-binutils-workaround.patch -# No const elements in std::vector -# https://github.com/chromium/chromium/commit/fd8ee2daf64a4348abca5dc9171523a1f9540c57#diff-45309c0989d0ee3ef14c373b6032b235c928574f72ac81e0b2ad8abf95c34547 -Patch70: chromium-96.0.4664.45-no-const-elements-in-std-vector.patch # Rawhide (f35) glibc defines SIGSTKSZ as a long instead of a constant Patch76: chromium-92.0.4515.107-rawhide-gcc-std-max-fix.patch @@ -314,7 +303,7 @@ Patch79: chromium-93.0.4577.63-widevine-no-download.patch # Fix crashes with components/cast_* # Thanks to Gentoo -Patch80: chromium-96-EnumTable-crash.patch +Patch80: chromium-98.0.4758.80-EnumTable-crash.patch # Add missing cmath header Patch84: chromium-94.0.4606.71-remoting-missing-cmath-header.patch @@ -323,10 +312,8 @@ Patch84: chromium-94.0.4606.71-remoting-missing-cmath-header.patch Patch86: chromium-94.0.4606.81-clang-format.patch # include full UrlResponseHead header Patch95: chromium-93.0.4577.63-mojo-header-fix.patch -# Fix multiple defines issue in webrtc/BUILD.gn -Patch96: chromium-94.0.4606.54-webrtc-BUILD.gn-fix-multiple-defines.patch # Fix extra qualification error -Patch97: chromium-94.0.4606.61-remoting-extra-qualification.patch +Patch97: chromium-98.0.4758.80-remoting-extra-qualification.patch # From gentoo Patch98: chromium-94.0.4606.71-InkDropHost-crash.patch # Enable WebRTCPPipeWireCapturer by default @@ -339,10 +326,10 @@ Patch101: chromium-75.0.3770.100-epel7-stdc++.patch # el7 only patch Patch102: chromium-80.0.3987.132-el7-noexcept.patch # Work around old and missing headers on EPEL7 -Patch103: chromium-90.0.4430.93-epel7-old-headers-workarounds.patch +Patch103: chromium-98.0.4758.80-epel7-old-headers-workarounds.patch # Use old cups (chromium's code workaround breaks on gcc) # Revert: https://github.com/chromium/chromium/commit/c3213f8779ddc427e89d982514185ed5e4c94e91 -Patch104: chromium-84.0.4147.89-epel7-old-cups.patch +Patch104: chromium-98.0.4758.80-epel7-old-cups.patch # Still not wrong, but it seems like only EL needs it Patch106: chromium-77-clang.patch # ARM failures on el8 related to int clashes @@ -355,15 +342,16 @@ Patch108: chromium-85.0.4183.83-el7-old-libdrm.patch # error: no matching function for call to 'std::basic_string::erase(std::basic_string::const_iterator, __gnu_cxx::__normal_iterator >&)' # 33 | property_name.erase(property_name.cbegin(), cur); # Not sure how this EVER worked anywhere, but it only seems to fail on EPEL-7. -Patch109: chromium-90.0.4430.93-epel7-erase-fix.patch +Patch109: chromium-98.0.4758.80-epel7-erase-fix.patch # Again, not sure how epel8 is the only one to hit this... # AARCH64 neon symbols need to be prefixed too to prevent multiple definition issue at linktime Patch110: chromium-90.0.4430.93-epel8-aarch64-libpng16-symbol-prefixes.patch - +# Add additional operator== to make el7 happy. +Patch111: chromium-98.0.4758.80-el7-extra-operator==.patch # VAAPI # Upstream turned VAAPI on in Linux in 86 -Patch202: chromium-89.0.4389.72-enable-hardware-accelerated-mjpeg.patch +Patch202: chromium-98.0.4758.80-enable-hardware-accelerated-mjpeg.patch Patch203: chromium-86.0.4240.75-vaapi-i686-fpermissive.patch Patch205: chromium-86.0.4240.75-fix-vaapi-on-intel.patch @@ -992,18 +980,13 @@ udev. %patch56 -p1 -b .missing-cstdint %patch57 -p1 -b .missing-cstring %patch58 -p1 -b .ffmpeg-deprecations -%patch59 -p1 -b .CouponDB-include -%patch60 -p1 -b .libyuv-aarch64 -%patch61 -p1 -b .CommandLine-include -%patch62 -p1 -b .RestrictedCookieManager-tuple -%patch63 -p1 -b .DrmRenderNodePathFinder-include +%patch60 -p1 -b .libyuv-arm +%patch61 -p1 -b .MiraclePtr-gcc-ice +%patch62 -p1 -b .WaylandFrameManager-check %patch64 -p1 -b .aarch64-cxxflags-addition %patch65 -p1 -b .java-only-allowed -%patch66 -p1 -b .gn-gcc-cleanup %patch67 -p1 -b .remoting-cstring %patch68 -p1 -b .i686-textrels -%patch69 -p1 -b .aarch64-clearkeycdm-binutils-workaround -%patch70 -p1 -b .no-const-elements-in-std-vector %if 0%{?fedora} >= 35 %patch76 -p1 -b .sigstkszfix %endif @@ -1012,7 +995,6 @@ udev. %patch84 -p1 -b .remoting-missing-cmath-header %patch86 -p1 -b .clang-format-py3 %patch95 -p1 -b .mojo-header-fix -%patch96 -p1 -b .webrtc-BUILD.gn-fix-multiple-defines %patch97 -p1 -b .remoting-extra-qualification %patch98 -p1 -b .InkDropHost-crash %patch99 -p1 -b .enable-WebRTCPipeWireCapturer-byDefault @@ -1030,6 +1012,7 @@ udev. %patch104 -p1 -b .el7cups %patch108 -p1 -b .el7-old-libdrm %patch109 -p1 -b .el7-erase-fix +%patch111 -p1 -b .el7-extra-operator-equalequal %endif %if 0%{?rhel} == 8 @@ -1144,7 +1127,7 @@ popd # Core defines are flags that are true for both the browser and headless. CHROMIUM_CORE_GN_DEFINES="" -CHROMIUM_CORE_GN_DEFINES+=' is_debug=false' +CHROMIUM_CORE_GN_DEFINES+=' is_debug=false dcheck_always_on=false dcheck_is_configurable=false' %ifarch x86_64 aarch64 CHROMIUM_CORE_GN_DEFINES+=' system_libdir="lib64"' %endif @@ -1216,7 +1199,7 @@ CHROMIUM_HEADLESS_GN_DEFINES+=' use_ozone=true ozone_auto_platforms=false ozone_ CHROMIUM_HEADLESS_GN_DEFINES+=' headless_use_embedded_resources=false icu_use_data_file=false v8_use_external_startup_data=false' CHROMIUM_HEADLESS_GN_DEFINES+=' enable_nacl=false enable_print_preview=false enable_remoting=false use_alsa=false' CHROMIUM_HEADLESS_GN_DEFINES+=' use_cups=false use_dbus=false use_gio=false use_kerberos=false use_libpci=false' -CHROMIUM_HEADLESS_GN_DEFINES+=' use_pulseaudio=false use_udev=false use_gtk=false use_glib=false use_x11=false' +CHROMIUM_HEADLESS_GN_DEFINES+=' use_pulseaudio=false use_udev=false use_gtk=false use_glib=false' export CHROMIUM_HEADLESS_GN_DEFINES %if 0%{?rhel} && 0%{?rhel} <= 8 @@ -1282,7 +1265,9 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/catapult/common/py_vulcanize/third_party/rcssmin' \ 'third_party/catapult/common/py_vulcanize/third_party/rjsmin' \ 'third_party/catapult/third_party/beautifulsoup4' \ + 'third_party/catapult/third_party/beautifulsoup4-4.9.3' \ 'third_party/catapult/third_party/google-endpoints' \ + 'third_party/catapult/third_party/html5lib-1.1' \ 'third_party/catapult/third_party/html5lib-python' \ 'third_party/catapult/third_party/polymer' \ 'third_party/catapult/third_party/six' \ @@ -1448,6 +1433,7 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/shell-encryption' \ 'third_party/simplejson' \ 'third_party/sinonjs' \ + 'third_party/six' \ 'third_party/skia' \ 'third_party/skia/include/third_party/skcms' \ 'third_party/skia/include/third_party/vulkan' \ @@ -1683,6 +1669,9 @@ echo %endif %endif +# bug #827861, vk_swiftshader_icd.json not getting properly installed in out/Release +sed -e 's|${ICD_LIBRARY_PATH}|./libvk_swiftshader.so|g' third_party/swiftshader/src/Vulkan/vk_swiftshader_icd.json.tmpl > out/Release/vk_swiftshader_icd.json + %install rm -rf %{buildroot} @@ -1727,6 +1716,8 @@ rm -rf %{buildroot} cp -a vk_swiftshader_icd.json %{buildroot}%{chromium_path} %endif cp -a chrome %{buildroot}%{chromium_path}/%{chromium_browser_channel} + # Explicitly strip chromium-browser (since we don't use debuginfo here anyway) + strip %{buildroot}%{chromium_path}/%{chromium_browser_channel} cp -a chrome_sandbox %{buildroot}%{chromium_path}/chrome-sandbox cp -a chrome_crashpad_handler %{buildroot}%{chromium_path}/chrome_crashpad_handler cp -a ../../chrome/app/resources/manpage.1.in %{buildroot}%{_mandir}/man1/%{chromium_browser_channel}.1 @@ -2121,6 +2112,12 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Wed Feb 2 2022 Tom Callaway - 98.0.4758.80-1 +- update to 98.0.4758.80 + +* Wed Jan 19 2022 Fedora Release Engineering - 96.0.4664.110-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Wed Jan 5 2022 Tom Callaway - 96.0.4664.110-7 - i hate regex. trying again diff --git a/sources b/sources index 1f17460..5f19837 100644 --- a/sources +++ b/sources @@ -21,4 +21,4 @@ SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1d SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a SHA512 (node-v12.22.6-linux-arm64.tar.xz) = 87ce5eb954deb1d0debe6fa02b28a3cc675e12fca1e51d44b123ab294aa39ce0c6b8ac9eae1e7a6e32673ea2c2d480651d9ba7eea73012f0529503eebe9eb34d SHA512 (node-v12.22.6-linux-x64.tar.xz) = e1b55c32343cb2ccc40d888c705414bebf9c46b02083d13731df79b1e79521b7277761f6bcca041e40e3a2e47c67bb8e7848aa2b919a9de5c2ebf62c4a9c7176 -SHA512 (chromium-96.0.4664.110-clean.tar.xz) = 87b72035e1c9f4b41f82e9fe9f47d2f1fdd16393ca851509bd76d843fe12c70da53452390f9cdc1dfcc660318fe3d8c91dd7d53ec2d927dc4dbbef6e36baca44 +SHA512 (chromium-98.0.4758.80-clean.tar.xz) = b3c95418683bc1ce24dcda8e1510fc5623ef97a9fca6574a75fb372648edaa078c715592c3f9fa0f6c0557b8edf1c3436faec093b620bef7b050a8c3aa4a2f96 From 8f14028d9831add019c627aee8cac3f12eaa0ea9 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Tue, 8 Feb 2022 10:01:48 -0500 Subject: [PATCH 072/659] strip headless_shell too --- chromium.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chromium.spec b/chromium.spec index 8ca7b9f..6961bae 100644 --- a/chromium.spec +++ b/chromium.spec @@ -1816,6 +1816,8 @@ rm -rf %{buildroot} %if %{build_headless} pushd %{headlessbuilddir} cp -a headless_lib.pak headless_shell %{buildroot}%{chromium_path} + # Explicitly strip headless_shell binary + strip %{buildroot}%{chromium_path}/headless_shell popd %endif From f4b6d8de2a6febeb9a3127ba591a1e68905c2095 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Tue, 8 Feb 2022 10:27:50 -0500 Subject: [PATCH 073/659] rhel7 macros are old --- chromium.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chromium.spec b/chromium.spec index be223d8..ba75d50 100644 --- a/chromium.spec +++ b/chromium.spec @@ -37,7 +37,11 @@ %global build_with_python3 1 %if 0%{?build_with_python3} +%if 0%{?rhel} == 7 +%global chromium_pybin /usr/bin/python3 +%else %global chromium_pybin %{__python3} +%endif %else %global chromium_pybin %{__python2} %endif From bf83007e0323548fd15eab9ad4344ee63990e1c4 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Wed, 16 Feb 2022 13:55:19 -0500 Subject: [PATCH 074/659] Add include for std::exchange --- ....0.4758.80-missing-utility-for-std-exchange.patch | 12 ++++++++++++ chromium.spec | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 chromium-98.0.4758.80-missing-utility-for-std-exchange.patch diff --git a/chromium-98.0.4758.80-missing-utility-for-std-exchange.patch b/chromium-98.0.4758.80-missing-utility-for-std-exchange.patch new file mode 100644 index 0000000..1b5a71f --- /dev/null +++ b/chromium-98.0.4758.80-missing-utility-for-std-exchange.patch @@ -0,0 +1,12 @@ +diff -up chromium-98.0.4758.80/base/third_party/symbolize/symbolize.h.f36 chromium-98.0.4758.80/base/third_party/symbolize/symbolize.h +--- chromium-98.0.4758.80/base/third_party/symbolize/symbolize.h.f36 2022-02-08 19:28:20.198873875 +0000 ++++ chromium-98.0.4758.80/base/third_party/symbolize/symbolize.h 2022-02-08 19:28:57.533127622 +0000 +@@ -58,6 +58,8 @@ + #include "config.h" + #include "glog/logging.h" + ++#include ++ + #ifdef HAVE_SYMBOLIZE + + #include diff --git a/chromium.spec b/chromium.spec index be223d8..99a3487 100644 --- a/chromium.spec +++ b/chromium.spec @@ -318,7 +318,8 @@ Patch97: chromium-98.0.4758.80-remoting-extra-qualification.patch Patch98: chromium-94.0.4606.71-InkDropHost-crash.patch # Enable WebRTCPPipeWireCapturer by default Patch99: chromium-96.0.4664.110-enable-WebRTCPipeWireCapturer-byDefault.patch - +# Add include for std::exchange +Patch100: chromium-98.0.4758.80-missing-utility-for-std-exchange.patch # Use lstdc++ on EPEL7 only @@ -998,6 +999,7 @@ udev. %patch97 -p1 -b .remoting-extra-qualification %patch98 -p1 -b .InkDropHost-crash %patch99 -p1 -b .enable-WebRTCPipeWireCapturer-byDefault +%patch100 -p1 -b .missing-utility-for-std-exchange # Fedora branded user agent %if 0%{?fedora} From 8dff5fe57ed46b4e2f3613a3b0e2324fc833bf3c Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Tue, 1 Mar 2022 17:59:29 -0500 Subject: [PATCH 075/659] 98.0.4758.102 --- ...ium-98.0.4758.102-gcc-12-subzero-fix.patch | 69 +++++++++++++++++++ ...mium-98.0.4758.102-remoting-no-tests.patch | 20 ++++++ ....80-missing-utility-for-std-exchange.patch | 17 ++++- chromium.spec | 14 +++- sources | 2 +- 5 files changed, 117 insertions(+), 5 deletions(-) create mode 100644 chromium-98.0.4758.102-gcc-12-subzero-fix.patch create mode 100644 chromium-98.0.4758.102-remoting-no-tests.patch diff --git a/chromium-98.0.4758.102-gcc-12-subzero-fix.patch b/chromium-98.0.4758.102-gcc-12-subzero-fix.patch new file mode 100644 index 0000000..fd5bbdb --- /dev/null +++ b/chromium-98.0.4758.102-gcc-12-subzero-fix.patch @@ -0,0 +1,69 @@ +diff -up chromium-98.0.4758.102/third_party/swiftshader/third_party/subzero/src/IceInstX8664.cpp.gcc12fix chromium-98.0.4758.102/third_party/swiftshader/third_party/subzero/src/IceInstX8664.cpp +--- chromium-98.0.4758.102/third_party/swiftshader/third_party/subzero/src/IceInstX8664.cpp.gcc12fix 2022-02-25 22:17:18.071775686 +0000 ++++ chromium-98.0.4758.102/third_party/swiftshader/third_party/subzero/src/IceInstX8664.cpp 2022-02-25 22:17:40.964996468 +0000 +@@ -659,6 +659,7 @@ void emitIASOpTyGPR(const Cfg *Func, Typ + } + } + ++#if 0 + template + void emitIASRegOpTyGPR(const Cfg *Func, Type Ty, const Variable *Var, + const Operand *Src, const GPREmitterRegOp &Emitter) { +@@ -697,6 +698,7 @@ void emitIASRegOpTyGPR(const Cfg *Func, + llvm_unreachable("Unexpected operand type"); + } + } ++#endif + + void emitIASAddrOpTyGPR(const Cfg *Func, Type Ty, const AsmAddress &Addr, + const Operand *Src, const GPREmitterAddrOp &Emitter) { +diff -up chromium-98.0.4758.102/third_party/swiftshader/third_party/subzero/src/IceInstX8664.h.gcc12fix chromium-98.0.4758.102/third_party/swiftshader/third_party/subzero/src/IceInstX8664.h +--- chromium-98.0.4758.102/third_party/swiftshader/third_party/subzero/src/IceInstX8664.h.gcc12fix 2022-02-25 22:17:51.409640955 +0000 ++++ chromium-98.0.4758.102/third_party/swiftshader/third_party/subzero/src/IceInstX8664.h 2022-02-25 22:19:13.478847553 +0000 +@@ -576,8 +576,44 @@ void emitIASXmmShift(const Cfg *Func, Ty + /// Emit a two-operand (GPR) instruction, where the dest operand is a Variable + /// that's guaranteed to be a register. + template +-void emitIASRegOpTyGPR(const Cfg *Func, Type Ty, const Variable *Dst, +- const Operand *Src, const GPREmitterRegOp &Emitter); ++ ++void emitIASRegOpTyGPR(const Cfg *Func, Type Ty, const Variable *Var, ++ const Operand *Src, const GPREmitterRegOp &Emitter) { ++ auto *Target = InstX86Base::getTarget(Func); ++ Assembler *Asm = Func->getAssembler(); ++ assert(Var->hasReg()); ++ // We cheat a little and use GPRRegister even for byte operations. ++ GPRRegister VarReg = VarCanBeByte ? RegX8664::getEncodedGPR(Var->getRegNum()) ++ : RegX8664::getEncodedGPR(Var->getRegNum()); ++ if (const auto *SrcVar = llvm::dyn_cast(Src)) { ++ if (SrcVar->hasReg()) { ++ GPRRegister SrcReg = SrcCanBeByte ++ ? RegX8664::getEncodedGPR(SrcVar->getRegNum()) ++ : RegX8664::getEncodedGPR(SrcVar->getRegNum()); ++ (Asm->*(Emitter.GPRGPR))(Ty, VarReg, SrcReg); ++ } else { ++ AsmAddress SrcStackAddr = AsmAddress(SrcVar, Target); ++ (Asm->*(Emitter.GPRAddr))(Ty, VarReg, SrcStackAddr); ++ } ++ } else if (const auto *Mem = llvm::dyn_cast(Src)) { ++ Mem->emitSegmentOverride(Asm); ++ (Asm->*(Emitter.GPRAddr))(Ty, VarReg, AsmAddress(Mem, Asm, Target)); ++ } else if (const auto *Imm = llvm::dyn_cast(Src)) { ++ (Asm->*(Emitter.GPRImm))(Ty, VarReg, AssemblerImmediate(Imm->getValue())); ++ } else if (const auto *Imm = llvm::dyn_cast(Src)) { ++ assert(Utils::IsInt(32, Imm->getValue())); ++ (Asm->*(Emitter.GPRImm))(Ty, VarReg, AssemblerImmediate(Imm->getValue())); ++ } else if (const auto *Reloc = llvm::dyn_cast(Src)) { ++ const auto FixupKind = (Reloc->getName().hasStdString() && ++ Reloc->getName().toString() == GlobalOffsetTable) ++ ? FK_GotPC ++ : FK_Abs; ++ AssemblerFixup *Fixup = Asm->createFixup(FixupKind, Reloc); ++ (Asm->*(Emitter.GPRImm))(Ty, VarReg, AssemblerImmediate(Fixup)); ++ } else { ++ llvm_unreachable("Unexpected operand type"); ++ } ++} + + /// Instructions of the form x := op(x). + template diff --git a/chromium-98.0.4758.102-remoting-no-tests.patch b/chromium-98.0.4758.102-remoting-no-tests.patch new file mode 100644 index 0000000..a8c4dbd --- /dev/null +++ b/chromium-98.0.4758.102-remoting-no-tests.patch @@ -0,0 +1,20 @@ +diff -up chromium-98.0.4758.102/remoting/BUILD.gn.remoting-no-tests chromium-98.0.4758.102/remoting/BUILD.gn +--- chromium-98.0.4758.102/remoting/BUILD.gn.remoting-no-tests 2022-02-28 19:15:23.835872267 +0000 ++++ chromium-98.0.4758.102/remoting/BUILD.gn 2022-03-01 17:55:50.625536957 +0000 +@@ -8,7 +8,7 @@ import("//remoting/build/config/remoting + group("remoting_all") { + testonly = true + +- deps = [ ":remoting_unittests" ] ++ deps = [ ] + + if (is_win) { + deps += [ +@@ -37,7 +37,6 @@ group("remoting_all") { + + if (enable_remoting_host) { + deps += [ +- ":remoting_perftests", + "//remoting/host", + ] + diff --git a/chromium-98.0.4758.80-missing-utility-for-std-exchange.patch b/chromium-98.0.4758.80-missing-utility-for-std-exchange.patch index 1b5a71f..1f6c7e8 100644 --- a/chromium-98.0.4758.80-missing-utility-for-std-exchange.patch +++ b/chromium-98.0.4758.80-missing-utility-for-std-exchange.patch @@ -1,6 +1,6 @@ -diff -up chromium-98.0.4758.80/base/third_party/symbolize/symbolize.h.f36 chromium-98.0.4758.80/base/third_party/symbolize/symbolize.h ---- chromium-98.0.4758.80/base/third_party/symbolize/symbolize.h.f36 2022-02-08 19:28:20.198873875 +0000 -+++ chromium-98.0.4758.80/base/third_party/symbolize/symbolize.h 2022-02-08 19:28:57.533127622 +0000 +diff -up chromium-98.0.4758.102/base/third_party/symbolize/symbolize.h.missing-utility-for-std-exchange chromium-98.0.4758.102/base/third_party/symbolize/symbolize.h +--- chromium-98.0.4758.102/base/third_party/symbolize/symbolize.h.missing-utility-for-std-exchange 2022-02-25 22:30:02.833745309 +0000 ++++ chromium-98.0.4758.102/base/third_party/symbolize/symbolize.h 2022-02-25 22:30:02.832745344 +0000 @@ -58,6 +58,8 @@ #include "config.h" #include "glog/logging.h" @@ -10,3 +10,14 @@ diff -up chromium-98.0.4758.80/base/third_party/symbolize/symbolize.h.f36 chromi #ifdef HAVE_SYMBOLIZE #include +diff -up chromium-98.0.4758.102/v8/src/heap/cppgc/prefinalizer-handler.h.missing-utility-for-std-exchange chromium-98.0.4758.102/v8/src/heap/cppgc/prefinalizer-handler.h +--- chromium-98.0.4758.102/v8/src/heap/cppgc/prefinalizer-handler.h.missing-utility-for-std-exchange 2022-02-27 20:08:40.027930037 +0000 ++++ chromium-98.0.4758.102/v8/src/heap/cppgc/prefinalizer-handler.h 2022-02-27 20:08:52.945490126 +0000 +@@ -5,6 +5,7 @@ + #ifndef V8_HEAP_CPPGC_PREFINALIZER_HANDLER_H_ + #define V8_HEAP_CPPGC_PREFINALIZER_HANDLER_H_ + ++#include + #include + + #include "include/cppgc/prefinalizer.h" diff --git a/chromium.spec b/chromium.spec index 99a3487..14ce080 100644 --- a/chromium.spec +++ b/chromium.spec @@ -220,7 +220,7 @@ Name: chromium%{chromium_channel}%{nsuffix} %else Name: chromium%{chromium_channel} %endif -Version: %{majorversion}.0.4758.80 +Version: %{majorversion}.0.4758.102 Release: 1%{?dist} %if %{?freeworld} %if %{?shared} @@ -304,6 +304,12 @@ Patch79: chromium-93.0.4577.63-widevine-no-download.patch # Fix crashes with components/cast_* # Thanks to Gentoo Patch80: chromium-98.0.4758.80-EnumTable-crash.patch +# Fix build issues with gcc12 +Patch81: chromium-98.0.4758.102-gcc-12-subzero-fix.patch +# Disable tests on remoting build +Patch82: chromium-98.0.4758.102-remoting-no-tests.patch + + # Add missing cmath header Patch84: chromium-94.0.4606.71-remoting-missing-cmath-header.patch @@ -993,6 +999,8 @@ udev. %endif %patch79 -p1 -b .widevine-no-download %patch80 -p1 -b .EnumTable-crash +%patch81 -p1 -b .gcc12fix +%patch82 -p1 -b .remoting-no-tests %patch84 -p1 -b .remoting-missing-cmath-header %patch86 -p1 -b .clang-format-py3 %patch95 -p1 -b .mojo-header-fix @@ -2116,6 +2124,10 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Fri Feb 25 2022 Tom Callaway - 98.0.4758.102-1 +- update to 98.0.4758.102 +- fix build issue with subzero and gcc12 + * Tue Feb 8 2022 Tom Callaway - 98.0.4758.80-1 - update to 98.0.4758.80 diff --git a/sources b/sources index 5f19837..6e2260c 100644 --- a/sources +++ b/sources @@ -21,4 +21,4 @@ SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1d SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a SHA512 (node-v12.22.6-linux-arm64.tar.xz) = 87ce5eb954deb1d0debe6fa02b28a3cc675e12fca1e51d44b123ab294aa39ce0c6b8ac9eae1e7a6e32673ea2c2d480651d9ba7eea73012f0529503eebe9eb34d SHA512 (node-v12.22.6-linux-x64.tar.xz) = e1b55c32343cb2ccc40d888c705414bebf9c46b02083d13731df79b1e79521b7277761f6bcca041e40e3a2e47c67bb8e7848aa2b919a9de5c2ebf62c4a9c7176 -SHA512 (chromium-98.0.4758.80-clean.tar.xz) = b3c95418683bc1ce24dcda8e1510fc5623ef97a9fca6574a75fb372648edaa078c715592c3f9fa0f6c0557b8edf1c3436faec093b620bef7b050a8c3aa4a2f96 +SHA512 (chromium-98.0.4758.102-clean.tar.xz) = c4d69e9e0c542a50a202ecc0fd2fb1b799110f825eb083878a2d965459e222fb5d319989aacd4f4f36ad38d51d82e1d3d4304cfba2dbebc8825555409114292a From 0834aaae899d1fc84f82e8a09b7a3841a389de33 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Sat, 5 Mar 2022 14:21:00 -0500 Subject: [PATCH 076/659] 99.0.4844.51 --- ...lAssistantModelExecutor-NoDestructor.patch | 32 +++++++++++++++++++ chromium-99.0.4844.51-fedora-user-agent.patch | 12 +++++++ ...um-99.0.4844.51-widevine-no-download.patch | 14 ++++++++ chromium.spec | 32 +++++++------------ sources | 2 +- 5 files changed, 70 insertions(+), 22 deletions(-) create mode 100644 chromium-99-AutofillAssistantModelExecutor-NoDestructor.patch create mode 100644 chromium-99.0.4844.51-fedora-user-agent.patch create mode 100644 chromium-99.0.4844.51-widevine-no-download.patch diff --git a/chromium-99-AutofillAssistantModelExecutor-NoDestructor.patch b/chromium-99-AutofillAssistantModelExecutor-NoDestructor.patch new file mode 100644 index 0000000..58b76a7 --- /dev/null +++ b/chromium-99-AutofillAssistantModelExecutor-NoDestructor.patch @@ -0,0 +1,32 @@ +From f1befebb6cea78950b5a8133bf3e65d56889d353 Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz +Date: Thu, 20 Jan 2022 09:38:13 +0100 +Subject: [PATCH] GCC: use braces initialization for NoDestructor in AutofillAssistantModelExecutor + +Fix build with GCC failing to resolve initialization of NoDestructor +with initializer list. + +Bug: 819294 +Change-Id: I5fe8d30b4aefdddd71ff7b220eeffcd838308f5a +--- + +diff --git a/components/autofill_assistant/content/renderer/autofill_assistant_model_executor.cc b/components/autofill_assistant/content/renderer/autofill_assistant_model_executor.cc +index 033205b..670376e 100644 +--- a/components/autofill_assistant/content/renderer/autofill_assistant_model_executor.cc ++++ b/components/autofill_assistant/content/renderer/autofill_assistant_model_executor.cc +@@ -156,13 +156,13 @@ + // TODO(b/204841212): Implement this with use of ModelMetadata. + absl::optional AutofillAssistantModelExecutor::Postprocess( + const std::vector& output_tensors) { +- static const base::NoDestructor> output_roles( ++ static const base::NoDestructor> output_roles{ + {"UNKNOWN_ROLE", "NAME_FIRST", "NAME_LAST", "NAME_FULL", "ADDRESS_LINE1", + "ADDRESS_LINE2", "CITY", "STATE", "COUNTRY", "POSTAL_CODE", + "CREDIT_CARD_NUMBER", "CREDIT_CARD_EXP_MONTH", + "CREDIT_CARD_VERIFICATION_CODE", "ORGANIZATION", + "CREDIT_CARD_EXPIRATION", "PHONE_NUMBER", "USERNAME_OR_EMAIL", +- "CREDIT_CARD_EXP_YEAR"}); ++ "CREDIT_CARD_EXP_YEAR"}}; + + DCHECK_GE(output_tensors.size(), 1u); + std::vector data; diff --git a/chromium-99.0.4844.51-fedora-user-agent.patch b/chromium-99.0.4844.51-fedora-user-agent.patch new file mode 100644 index 0000000..054ba4a --- /dev/null +++ b/chromium-99.0.4844.51-fedora-user-agent.patch @@ -0,0 +1,12 @@ +diff -up chromium-99.0.4844.51/content/common/user_agent.cc.fedora-user-agent chromium-99.0.4844.51/content/common/user_agent.cc +--- chromium-99.0.4844.51/content/common/user_agent.cc.fedora-user-agent 2022-03-04 15:06:27.774789749 +0000 ++++ chromium-99.0.4844.51/content/common/user_agent.cc 2022-03-04 15:07:22.837911148 +0000 +@@ -34,7 +34,7 @@ std::string GetUserAgentPlatform() { + #elif BUILDFLAG(IS_MAC) + return "Macintosh; "; + #elif defined(USE_OZONE) +- return "X11; "; // strange, but that's what Firefox uses ++ return "X11; Fedora; "; // strange, but that's what Firefox uses + #elif BUILDFLAG(IS_ANDROID) + return "Linux; "; + #elif BUILDFLAG(IS_FUCHSIA) diff --git a/chromium-99.0.4844.51-widevine-no-download.patch b/chromium-99.0.4844.51-widevine-no-download.patch new file mode 100644 index 0000000..951840d --- /dev/null +++ b/chromium-99.0.4844.51-widevine-no-download.patch @@ -0,0 +1,14 @@ +diff -up chromium-99.0.4844.51/chrome/browser/component_updater/registration.cc.widevine-no-download chromium-99.0.4844.51/chrome/browser/component_updater/registration.cc +--- chromium-99.0.4844.51/chrome/browser/component_updater/registration.cc.widevine-no-download 2022-03-04 14:57:16.459599123 +0000 ++++ chromium-99.0.4844.51/chrome/browser/component_updater/registration.cc 2022-03-04 14:58:39.560763939 +0000 +@@ -105,10 +105,6 @@ void RegisterComponentsForUpdate() { + RegisterMediaFoundationWidevineCdmComponent(cus); + #endif + +-#if BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT) +- RegisterWidevineCdmComponent(cus); +-#endif // BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT) +- + #if BUILDFLAG(ENABLE_NACL) && !BUILDFLAG(IS_ANDROID) + #if BUILDFLAG(IS_CHROMEOS_ASH) + // PNaCl on Chrome OS is on rootfs and there is no need to download it. But diff --git a/chromium.spec b/chromium.spec index 14ce080..5ce750c 100644 --- a/chromium.spec +++ b/chromium.spec @@ -213,14 +213,14 @@ BuildRequires: libicu-devel >= 5.4 %global chromoting_client_id %nil %endif -%global majorversion 98 +%global majorversion 99 %if %{freeworld} Name: chromium%{chromium_channel}%{nsuffix} %else Name: chromium%{chromium_channel} %endif -Version: %{majorversion}.0.4758.102 +Version: %{majorversion}.0.4844.51 Release: 1%{?dist} %if %{?freeworld} %if %{?shared} @@ -264,7 +264,7 @@ Patch11: chromium-93.0.4577.63-py3-bootstrap.patch Patch11: chromium-92.0.4515.107-py2-bootstrap.patch %endif # Add "Fedora" to the user agent string -Patch12: chromium-98.0.4758.80-fedora-user-agent.patch +Patch12: chromium-99.0.4844.51-fedora-user-agent.patch # Needs to be submitted.. Patch51: chromium-96.0.4664.45-gcc-remoting-constexpr.patch @@ -279,12 +279,8 @@ Patch57: chromium-96.0.4664.45-missing-cstring.patch # prepare for using system ffmpeg (clean) # http://svnweb.mageia.org/packages/cauldron/chromium-browser-stable/current/SOURCES/chromium-53-ffmpeg-no-deprecation-errors.patch?view=markup Patch58: chromium-53-ffmpeg-no-deprecation-errors.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-95-libyuv-arm.patch -Patch60: chromium-95-libyuv-arm.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-98-MiraclePtr-gcc-ice.patch -Patch61: chromium-98-MiraclePtr-gcc-ice.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-98-WaylandFrameManager-check.patch -Patch62: chromium-98-WaylandFrameManager-check.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-99-AutofillAssistantModelExecutor-NoDestructor.patch +Patch60: chromium-99-AutofillAssistantModelExecutor-NoDestructor.patch # Extra CXXFLAGS for aarch64 Patch64: chromium-91.0.4472.77-aarch64-cxxflags-addition.patch # Fix issue where closure_compiler thinks java is only allowed in android builds @@ -296,10 +292,8 @@ Patch67: chromium-98.0.4758.80-remoting-cstring.patch # Apply fix_textrels hack for i686 (even without lld) Patch68: chromium-84.0.4147.125-i686-fix_textrels.patch -# Rawhide (f35) glibc defines SIGSTKSZ as a long instead of a constant -Patch76: chromium-92.0.4515.107-rawhide-gcc-std-max-fix.patch # Do not download proprietary widevine module in the background (thanks Debian) -Patch79: chromium-93.0.4577.63-widevine-no-download.patch +Patch79: chromium-99.0.4844.51-widevine-no-download.patch # Fix crashes with components/cast_* # Thanks to Gentoo @@ -316,8 +310,6 @@ Patch84: chromium-94.0.4606.71-remoting-missing-cmath-header.patch # Clean up clang-format for python3 # thanks to Jon Nettleton Patch86: chromium-94.0.4606.81-clang-format.patch -# include full UrlResponseHead header -Patch95: chromium-93.0.4577.63-mojo-header-fix.patch # Fix extra qualification error Patch97: chromium-98.0.4758.80-remoting-extra-qualification.patch # From gentoo @@ -987,23 +979,17 @@ udev. %patch56 -p1 -b .missing-cstdint %patch57 -p1 -b .missing-cstring %patch58 -p1 -b .ffmpeg-deprecations -%patch60 -p1 -b .libyuv-arm -%patch61 -p1 -b .MiraclePtr-gcc-ice -%patch62 -p1 -b .WaylandFrameManager-check +%patch60 -p1 -b .AutofillAssistantModelExecutor-NoDestructor %patch64 -p1 -b .aarch64-cxxflags-addition %patch65 -p1 -b .java-only-allowed %patch67 -p1 -b .remoting-cstring %patch68 -p1 -b .i686-textrels -%if 0%{?fedora} >= 35 -%patch76 -p1 -b .sigstkszfix -%endif %patch79 -p1 -b .widevine-no-download %patch80 -p1 -b .EnumTable-crash %patch81 -p1 -b .gcc12fix %patch82 -p1 -b .remoting-no-tests %patch84 -p1 -b .remoting-missing-cmath-header %patch86 -p1 -b .clang-format-py3 -%patch95 -p1 -b .mojo-header-fix %patch97 -p1 -b .remoting-extra-qualification %patch98 -p1 -b .InkDropHost-crash %patch99 -p1 -b .enable-WebRTCPipeWireCapturer-byDefault @@ -1304,6 +1290,7 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/devscripts' \ 'third_party/devtools-frontend' \ 'third_party/devtools-frontend/src/third_party/typescript' \ + 'third_party/devtools-frontend/src/front_end/third_party' \ 'third_party/devtools-frontend/src/front_end/third_party/acorn' \ 'third_party/devtools-frontend/src/front_end/third_party/axe-core' \ 'third_party/devtools-frontend/src/front_end/third_party/chromium' \ @@ -2124,6 +2111,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Sat Mar 5 2022 Tom Callaway - 99.0.4844.5-1 +- update to 99.0.4844.5 + * Fri Feb 25 2022 Tom Callaway - 98.0.4758.102-1 - update to 98.0.4758.102 - fix build issue with subzero and gcc12 diff --git a/sources b/sources index 6e2260c..141bbba 100644 --- a/sources +++ b/sources @@ -21,4 +21,4 @@ SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1d SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a SHA512 (node-v12.22.6-linux-arm64.tar.xz) = 87ce5eb954deb1d0debe6fa02b28a3cc675e12fca1e51d44b123ab294aa39ce0c6b8ac9eae1e7a6e32673ea2c2d480651d9ba7eea73012f0529503eebe9eb34d SHA512 (node-v12.22.6-linux-x64.tar.xz) = e1b55c32343cb2ccc40d888c705414bebf9c46b02083d13731df79b1e79521b7277761f6bcca041e40e3a2e47c67bb8e7848aa2b919a9de5c2ebf62c4a9c7176 -SHA512 (chromium-98.0.4758.102-clean.tar.xz) = c4d69e9e0c542a50a202ecc0fd2fb1b799110f825eb083878a2d965459e222fb5d319989aacd4f4f36ad38d51d82e1d3d4304cfba2dbebc8825555409114292a +SHA512 (chromium-99.0.4844.51-clean.tar.xz) = b9c46bc120b4ec5841ee91c9c752cfb7178c885b9b324ca3512645a583375967cc82beb560364d0ec8028bd25e33f5933b52ef815c42ea0dbe5ddb724b5b30c5 From fed246998c27ef6abd6ee12e9192dc318874bfc7 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Sat, 5 Mar 2022 14:26:19 -0500 Subject: [PATCH 077/659] merge + rhel 8 fix --- ...44.51-rhel8-force-disable-use_gnome_keyring.patch | 12 ++++++++++++ chromium.spec | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 chromium-99.0.4844.51-rhel8-force-disable-use_gnome_keyring.patch diff --git a/chromium-99.0.4844.51-rhel8-force-disable-use_gnome_keyring.patch b/chromium-99.0.4844.51-rhel8-force-disable-use_gnome_keyring.patch new file mode 100644 index 0000000..a65f244 --- /dev/null +++ b/chromium-99.0.4844.51-rhel8-force-disable-use_gnome_keyring.patch @@ -0,0 +1,12 @@ +diff -up chromium-99.0.4844.51/components/os_crypt/features.gni.disblegnomekeyring chromium-99.0.4844.51/components/os_crypt/features.gni +--- chromium-99.0.4844.51/components/os_crypt/features.gni.disblegnomekeyring 2022-03-05 14:24:15.073877597 -0500 ++++ chromium-99.0.4844.51/components/os_crypt/features.gni 2022-03-05 14:25:04.174183483 -0500 +@@ -8,7 +8,7 @@ import("//build/config/ui.gni") + declare_args() { + # Whether to use libgnome-keyring (deprecated by libsecret). + # See http://crbug.com/466975 and http://crbug.com/355223. +- use_gnome_keyring = is_linux && use_glib ++ use_gnome_keyring = false + + # Whether to make account and service names for the crypto key storage + # configurable at runtime for embedders. diff --git a/chromium.spec b/chromium.spec index 5ce750c..e9616a4 100644 --- a/chromium.spec +++ b/chromium.spec @@ -355,7 +355,7 @@ Patch203: chromium-86.0.4240.75-vaapi-i686-fpermissive.patch Patch205: chromium-86.0.4240.75-fix-vaapi-on-intel.patch # Apply these patches to work around EPEL8 issues -Patch300: chromium-92.0.4515.107-rhel8-force-disable-use_gnome_keyring.patch +Patch300: chromium-99.0.4844.51-rhel8-force-disable-use_gnome_keyring.patch # And fixes for new compilers Patch400: %{name}-gcc11.patch From 957476f7b804c4692f1ac3882ba0b6e73c1d9b2a Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Sat, 5 Mar 2022 18:40:44 -0500 Subject: [PATCH 078/659] epel7 fixes --- chromium-99.0.4844.51-epel7-old-cups.patch | 142 ++++++++++++++++++ ...844.51-epel7-old-headers-workarounds.patch | 127 ++++++++++++++++ chromium.spec | 4 +- 3 files changed, 271 insertions(+), 2 deletions(-) create mode 100644 chromium-99.0.4844.51-epel7-old-cups.patch create mode 100644 chromium-99.0.4844.51-epel7-old-headers-workarounds.patch diff --git a/chromium-99.0.4844.51-epel7-old-cups.patch b/chromium-99.0.4844.51-epel7-old-cups.patch new file mode 100644 index 0000000..ec0dedc --- /dev/null +++ b/chromium-99.0.4844.51-epel7-old-cups.patch @@ -0,0 +1,142 @@ +diff -up chromium-99.0.4844.51/printing/backend/cups_helper.cc.el7cups chromium-99.0.4844.51/printing/backend/cups_helper.cc +--- chromium-99.0.4844.51/printing/backend/cups_helper.cc.el7cups 2022-02-28 19:05:55.000000000 -0500 ++++ chromium-99.0.4844.51/printing/backend/cups_helper.cc 2022-03-05 15:17:45.516887985 -0500 +@@ -34,18 +34,6 @@ namespace printing { + // This section contains helper code for PPD parsing for semantic capabilities. + namespace { + +-// Function availability can be tested by checking whether its address is not +-// nullptr. Weak symbols remove the need for platform specific build flags and +-// allow for appropriate CUPS usage on platforms with non-uniform version +-// support, namely Linux. +-#define WEAK_CUPS_FN(x) extern "C" __attribute__((weak)) decltype(x) x +- +-WEAK_CUPS_FN(httpConnect2); +- +-// Timeout for establishing a CUPS connection. It is expected that cupsd is +-// able to start and respond on all systems within this duration. +-constexpr base::TimeDelta kCupsTimeout = base::Seconds(5); +- + // CUPS default max copies value (parsed from kCupsMaxCopies PPD attribute). + constexpr int32_t kDefaultMaxCopies = 9999; + constexpr char kCupsMaxCopies[] = "cupsMaxCopies"; +@@ -527,8 +515,7 @@ const int kDefaultIPPServerPort = 631; + // Helper wrapper around http_t structure, with connection and cleanup + // functionality. + HttpConnectionCUPS::HttpConnectionCUPS(const GURL& print_server_url, +- http_encryption_t encryption, +- bool blocking) ++ http_encryption_t encryption) + : http_(nullptr) { + // If we have an empty url, use default print server. + if (print_server_url.is_empty()) +@@ -538,17 +525,10 @@ HttpConnectionCUPS::HttpConnectionCUPS(c + if (port == url::PORT_UNSPECIFIED) + port = kDefaultIPPServerPort; + +- if (httpConnect2) { +- http_ = httpConnect2(print_server_url.host().c_str(), port, +- /*addrlist=*/nullptr, AF_UNSPEC, encryption, +- blocking ? 1 : 0, kCupsTimeout.InMilliseconds(), +- /*cancel=*/nullptr); +- } else { +- // Continue to use deprecated CUPS calls because because older Linux +- // distribution such as RHEL/CentOS 7 are shipped with CUPS 1.6. +- http_ = +- httpConnectEncrypt(print_server_url.host().c_str(), port, encryption); +- } ++ // Continue to use deprecated CUPS calls because because older Linux ++ // distribution such as RHEL/CentOS 7 are shipped with CUPS 1.6. ++ http_ = ++ httpConnectEncrypt(print_server_url.host().c_str(), port, encryption); + + if (!http_) { + LOG(ERROR) << "CP_CUPS: Failed connecting to print server: " +@@ -556,8 +536,6 @@ HttpConnectionCUPS::HttpConnectionCUPS(c + return; + } + +- if (!httpConnect2) +- httpBlocking(http_, blocking ? 1 : 0); + } + + HttpConnectionCUPS::~HttpConnectionCUPS() { +@@ -565,6 +543,10 @@ HttpConnectionCUPS::~HttpConnectionCUPS( + httpClose(http_); + } + ++void HttpConnectionCUPS::SetBlocking(bool blocking) { ++ httpBlocking(http_, blocking ? 1 : 0); ++} ++ + http_t* HttpConnectionCUPS::http() { + return http_; + } +diff -up chromium-99.0.4844.51/printing/backend/cups_helper.h.el7cups chromium-99.0.4844.51/printing/backend/cups_helper.h +--- chromium-99.0.4844.51/printing/backend/cups_helper.h.el7cups 2022-02-28 19:05:55.000000000 -0500 ++++ chromium-99.0.4844.51/printing/backend/cups_helper.h 2022-03-05 15:17:45.517887991 -0500 +@@ -34,10 +34,11 @@ constexpr cups_ptype_t kDestinationsFilt + class COMPONENT_EXPORT(PRINT_BACKEND) HttpConnectionCUPS { + public: + HttpConnectionCUPS(const GURL& print_server_url, +- http_encryption_t encryption, +- bool blocking); ++ http_encryption_t encryption); + ~HttpConnectionCUPS(); + ++ void SetBlocking(bool blocking); ++ + http_t* http(); + + private: +diff -up chromium-99.0.4844.51/printing/backend/print_backend_cups.cc.el7cups chromium-99.0.4844.51/printing/backend/print_backend_cups.cc +--- chromium-99.0.4844.51/printing/backend/print_backend_cups.cc.el7cups 2022-02-28 19:05:55.000000000 -0500 ++++ chromium-99.0.4844.51/printing/backend/print_backend_cups.cc 2022-03-05 15:17:45.517887991 -0500 +@@ -146,7 +146,7 @@ mojom::ResultCode PrintBackendCUPS::Enum + // not showing as available. Using cupsEnumDests() allows us to do our own + // filtering should any duplicates occur. + CupsDestsData dests_data = {0, nullptr}; +- ipp_status_t last_error = IPP_STATUS_OK; ++ ipp_status_t last_error = IPP_OK; + if (print_server_url_.is_empty()) { + VLOG(1) << "CUPS: using cupsEnumDests to enumerate printers"; + if (!cupsEnumDests(CUPS_DEST_FLAGS_NONE, kCupsTimeoutMs, +@@ -173,7 +173,7 @@ mojom::ResultCode PrintBackendCUPS::Enum + // no printer drivers installed. Rely upon CUPS error code to distinguish + // between these. + DCHECK(!dests_data.dests); +- if (last_error != IPP_STATUS_ERROR_NOT_FOUND) { ++ if (last_error != IPP_NOT_FOUND) { + VLOG(1) << "CUPS: Error getting printers from CUPS server" + << ", server: " << print_server_url_ + << ", error: " << static_cast(last_error) << " - " +@@ -336,7 +336,8 @@ int PrintBackendCUPS::GetDests(cups_dest + if (print_server_url_.is_empty()) + return cupsGetDests2(CUPS_HTTP_DEFAULT, dests); + +- HttpConnectionCUPS http(print_server_url_, cups_encryption_, blocking_); ++ HttpConnectionCUPS http(print_server_url_, cups_encryption_); ++ http.SetBlocking(blocking_); + + // This call must be made in the same scope as `http` because its destructor + // closes the connection. +@@ -362,7 +363,8 @@ base::FilePath PrintBackendCUPS::GetPPD( + // connection will timeout after 10 seconds of no data period. And it will + // return the same way as if data was completely and successfully + // downloaded. +- HttpConnectionCUPS http(print_server_url_, cups_encryption_, blocking_); ++ HttpConnectionCUPS http(print_server_url_, cups_encryption_); ++ http.SetBlocking(blocking_); + ppd_file_path = cupsGetPPD2(http.http(), name); + // Check if the get full PPD, since non-blocking call may simply return + // normally after timeout expired. +@@ -398,7 +400,8 @@ PrintBackendCUPS::ScopedDestination Prin + // Use default (local) print server. + dest = cupsGetNamedDest(CUPS_HTTP_DEFAULT, printer_name.c_str(), nullptr); + } else { +- HttpConnectionCUPS http(print_server_url_, cups_encryption_, blocking_); ++ HttpConnectionCUPS http(print_server_url_, cups_encryption_); ++ http.SetBlocking(blocking_); + dest = cupsGetNamedDest(http.http(), printer_name.c_str(), nullptr); + } + return ScopedDestination(dest); diff --git a/chromium-99.0.4844.51-epel7-old-headers-workarounds.patch b/chromium-99.0.4844.51-epel7-old-headers-workarounds.patch new file mode 100644 index 0000000..1da00cf --- /dev/null +++ b/chromium-99.0.4844.51-epel7-old-headers-workarounds.patch @@ -0,0 +1,127 @@ +diff -up chromium-99.0.4844.51/mojo/core/channel_linux.cc.epel7-header-workarounds chromium-99.0.4844.51/mojo/core/channel_linux.cc +--- chromium-99.0.4844.51/mojo/core/channel_linux.cc.epel7-header-workarounds 2022-02-28 19:05:54.000000000 -0500 ++++ chromium-99.0.4844.51/mojo/core/channel_linux.cc 2022-03-05 14:50:49.876812909 -0500 +@@ -44,6 +44,25 @@ + #include "base/android/build_info.h" + #endif + ++#ifndef F_LINUX_SPECIFIC_BASE ++#define F_LINUX_SPECIFIC_BASE 1024 ++#endif ++#ifndef F_SEAL_SEAL ++#define F_SEAL_SEAL 0x0001 ++#endif ++#ifndef F_SEAL_SHRINK ++#define F_SEAL_SHRINK 0x0002 ++#endif ++#ifndef F_SEAL_GROW ++#define F_SEAL_GROW 0x0004 ++#endif ++#ifndef F_ADD_SEALS ++#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9) ++#endif ++#ifndef F_GET_SEALS ++#define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10) ++#endif ++ + #ifndef EFD_ZERO_ON_WAKE + #define EFD_ZERO_ON_WAKE O_NOFOLLOW + #endif +diff -up chromium-99.0.4844.51/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc.epel7-header-workarounds chromium-99.0.4844.51/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc +--- chromium-99.0.4844.51/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc.epel7-header-workarounds 2022-03-05 14:50:49.877812915 -0500 ++++ chromium-99.0.4844.51/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc 2022-03-05 15:15:02.536867009 -0500 +@@ -53,6 +53,25 @@ + + #endif // BUILDFLAG(IS_ANDROID) + ++#ifndef F_LINUX_SPECIFIC_BASE ++#define F_LINUX_SPECIFIC_BASE 1024 ++#endif ++#ifndef F_SEAL_SEAL ++#define F_SEAL_SEAL 0x0001 ++#endif ++#ifndef F_SEAL_SHRINK ++#define F_SEAL_SHRINK 0x0002 ++#endif ++#ifndef F_SEAL_GROW ++#define F_SEAL_GROW 0x0004 ++#endif ++#ifndef F_ADD_SEALS ++#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9) ++#endif ++#ifndef F_GET_SEALS ++#define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10) ++#endif ++ + #if defined(__arm__) && !defined(MAP_STACK) + #define MAP_STACK 0x20000 // Daisy build environment has old headers. + #endif +diff -up chromium-99.0.4844.51/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc.epel7-header-workarounds chromium-99.0.4844.51/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc +--- chromium-99.0.4844.51/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc.epel7-header-workarounds 2022-02-28 19:05:55.000000000 -0500 ++++ chromium-99.0.4844.51/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc 2022-03-05 14:50:49.877812915 -0500 +@@ -6,7 +6,24 @@ + + #include + #include +-#include ++#ifndef KCMP_FILE ++#define KCMP_FILE 0 ++#endif ++#ifndef F_LINUX_SPECIFIC_BASE ++#define F_LINUX_SPECIFIC_BASE 1024 ++#endif ++#ifndef F_SEAL_SEAL ++#define F_SEAL_SEAL 0x0001 ++#endif ++#ifndef F_SEAL_SHRINK ++#define F_SEAL_SHRINK 0x0002 ++#endif ++#ifndef F_SEAL_GROW ++#define F_SEAL_GROW 0x0004 ++#endif ++#ifndef F_ADD_SEALS ++#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9) ++#endif + #include + + // Some arch's (arm64 for instance) unistd.h don't pull in symbols used here +diff -up chromium-99.0.4844.51/sandbox/policy/linux/bpf_gpu_policy_linux.cc.epel7-header-workarounds chromium-99.0.4844.51/sandbox/policy/linux/bpf_gpu_policy_linux.cc +--- chromium-99.0.4844.51/sandbox/policy/linux/bpf_gpu_policy_linux.cc.epel7-header-workarounds 2022-02-28 19:05:55.000000000 -0500 ++++ chromium-99.0.4844.51/sandbox/policy/linux/bpf_gpu_policy_linux.cc 2022-03-05 14:50:49.877812915 -0500 +@@ -22,6 +22,22 @@ + #include "sandbox/policy/linux/sandbox_linux.h" + #include "sandbox/policy/linux/sandbox_seccomp_bpf_linux.h" + ++#ifndef F_LINUX_SPECIFIC_BASE ++#define F_LINUX_SPECIFIC_BASE 1024 ++#endif ++#ifndef F_SEAL_SEAL ++#define F_SEAL_SEAL 0x0001 ++#endif ++#ifndef F_SEAL_SHRINK ++#define F_SEAL_SHRINK 0x0002 ++#endif ++#ifndef F_SEAL_GROW ++#define F_SEAL_GROW 0x0004 ++#endif ++#ifndef F_ADD_SEALS ++#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9) ++#endif ++ + using sandbox::bpf_dsl::AllOf; + using sandbox::bpf_dsl::Allow; + using sandbox::bpf_dsl::Arg; +diff -up chromium-99.0.4844.51/ui/events/ozone/evdev/event_converter_evdev_impl.cc.epel7-header-workarounds chromium-99.0.4844.51/ui/events/ozone/evdev/event_converter_evdev_impl.cc +--- chromium-99.0.4844.51/ui/events/ozone/evdev/event_converter_evdev_impl.cc.epel7-header-workarounds 2022-02-28 19:06:49.000000000 -0500 ++++ chromium-99.0.4844.51/ui/events/ozone/evdev/event_converter_evdev_impl.cc 2022-03-05 14:50:49.877812915 -0500 +@@ -23,6 +23,10 @@ + #include "ui/events/ozone/evdev/numberpad_metrics.h" + #endif + ++#ifndef SW_PEN_INSERTED ++#define SW_PEN_INSERTED 0x0f /* set = pen inserted */ ++#endif ++ + namespace ui { + + namespace { diff --git a/chromium.spec b/chromium.spec index 4267915..5559291 100644 --- a/chromium.spec +++ b/chromium.spec @@ -329,10 +329,10 @@ Patch101: chromium-75.0.3770.100-epel7-stdc++.patch # el7 only patch Patch102: chromium-80.0.3987.132-el7-noexcept.patch # Work around old and missing headers on EPEL7 -Patch103: chromium-98.0.4758.80-epel7-old-headers-workarounds.patch +Patch103: chromium-99.0.4844.51-epel7-old-headers-workarounds.patch # Use old cups (chromium's code workaround breaks on gcc) # Revert: https://github.com/chromium/chromium/commit/c3213f8779ddc427e89d982514185ed5e4c94e91 -Patch104: chromium-98.0.4758.80-epel7-old-cups.patch +Patch104: chromium-99.0.4844.51-epel7-old-cups.patch # Still not wrong, but it seems like only EL needs it Patch106: chromium-77-clang.patch # ARM failures on el8 related to int clashes From 47302ecee7b1cb2e7bf42b00468e439ad05dea86 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Sun, 6 Mar 2022 19:16:59 -0500 Subject: [PATCH 079/659] another == operator hack --- ...um-99.0.4844.51-el7-extra-operator==.patch | 26 +++++++++++++++++++ chromium.spec | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 chromium-99.0.4844.51-el7-extra-operator==.patch diff --git a/chromium-99.0.4844.51-el7-extra-operator==.patch b/chromium-99.0.4844.51-el7-extra-operator==.patch new file mode 100644 index 0000000..34c89d0 --- /dev/null +++ b/chromium-99.0.4844.51-el7-extra-operator==.patch @@ -0,0 +1,26 @@ +diff -up chromium-99.0.4844.51/base/allocator/partition_allocator/starscan/metadata_allocator.h.el7-extra-operator-equalequal chromium-99.0.4844.51/base/allocator/partition_allocator/starscan/metadata_allocator.h +--- chromium-99.0.4844.51/base/allocator/partition_allocator/starscan/metadata_allocator.h.el7-extra-operator-equalequal 2022-03-05 18:37:25.979241754 -0500 ++++ chromium-99.0.4844.51/base/allocator/partition_allocator/starscan/metadata_allocator.h 2022-03-05 18:37:25.979241754 -0500 +@@ -39,6 +39,11 @@ class MetadataAllocator { + } + + template ++ bool operator==(const MetadataAllocator&) const { ++ return true; ++ } ++ ++ template + bool operator!=(const MetadataAllocator& o) { + return !operator==(o); + } +diff -up chromium-99.0.4844.51/third_party/pdfium/core/fxcrt/fx_memory_wrappers.h.el7-extra-operator-equalequal chromium-99.0.4844.51/third_party/pdfium/core/fxcrt/fx_memory_wrappers.h +--- chromium-99.0.4844.51/third_party/pdfium/core/fxcrt/fx_memory_wrappers.h.el7-extra-operator-equalequal 2022-03-06 19:14:20.892513442 -0500 ++++ chromium-99.0.4844.51/third_party/pdfium/core/fxcrt/fx_memory_wrappers.h 2022-03-06 19:15:40.412060574 -0500 +@@ -70,6 +70,7 @@ struct FxPartitionAllocAllocator { + } + + // There's no state, so they are all the same, ++ bool operator==(const FxPartitionAllocAllocator&) const { return true; } + bool operator==(const FxPartitionAllocAllocator& that) { return true; } + bool operator!=(const FxPartitionAllocAllocator& that) { return false; } + }; diff --git a/chromium.spec b/chromium.spec index 5559291..ccd3f33 100644 --- a/chromium.spec +++ b/chromium.spec @@ -350,7 +350,7 @@ Patch109: chromium-98.0.4758.80-epel7-erase-fix.patch # AARCH64 neon symbols need to be prefixed too to prevent multiple definition issue at linktime Patch110: chromium-90.0.4430.93-epel8-aarch64-libpng16-symbol-prefixes.patch # Add additional operator== to make el7 happy. -Patch111: chromium-98.0.4758.80-el7-extra-operator==.patch +Patch111: chromium-99.0.4844.51-el7-extra-operator==.patch # VAAPI # Upstream turned VAAPI on in Linux in 86 From ae7824bf00be705799d16e574706aa8d0487a398 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Sat, 19 Mar 2022 04:29:33 -0400 Subject: [PATCH 080/659] update to 99.0.4844.74 --- chromium.spec | 5 ++++- sources | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/chromium.spec b/chromium.spec index ccd3f33..60a7f80 100644 --- a/chromium.spec +++ b/chromium.spec @@ -224,7 +224,7 @@ Name: chromium%{chromium_channel}%{nsuffix} %else Name: chromium%{chromium_channel} %endif -Version: %{majorversion}.0.4844.51 +Version: %{majorversion}.0.4844.74 Release: 1%{?dist} %if %{?freeworld} %if %{?shared} @@ -2115,6 +2115,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Sat Mar 19 2022 Tom Callaway - 99.0.4844.74-1 +- update to 99.0.4844.74 + * Sat Mar 5 2022 Tom Callaway - 99.0.4844.5-1 - update to 99.0.4844.5 diff --git a/sources b/sources index 141bbba..e41ab3a 100644 --- a/sources +++ b/sources @@ -21,4 +21,4 @@ SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1d SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a SHA512 (node-v12.22.6-linux-arm64.tar.xz) = 87ce5eb954deb1d0debe6fa02b28a3cc675e12fca1e51d44b123ab294aa39ce0c6b8ac9eae1e7a6e32673ea2c2d480651d9ba7eea73012f0529503eebe9eb34d SHA512 (node-v12.22.6-linux-x64.tar.xz) = e1b55c32343cb2ccc40d888c705414bebf9c46b02083d13731df79b1e79521b7277761f6bcca041e40e3a2e47c67bb8e7848aa2b919a9de5c2ebf62c4a9c7176 -SHA512 (chromium-99.0.4844.51-clean.tar.xz) = b9c46bc120b4ec5841ee91c9c752cfb7178c885b9b324ca3512645a583375967cc82beb560364d0ec8028bd25e33f5933b52ef815c42ea0dbe5ddb724b5b30c5 +SHA512 (chromium-99.0.4844.74-clean.tar.xz) = 70df44fb6289977bd4a0b818b1d620ba2cca7da72d60ade8928eef6a5d822afd788d93cc169ff3b670addb62dd2ac7c5cf51d5698da5937caaf560a53a1b376c From 4f9ee801ed033191de64c6e621f0208f6d6e30c7 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Sun, 27 Mar 2022 09:46:48 -0400 Subject: [PATCH 081/659] 99.0.4844.84, remote desktop library fix, size fixes --- chromium.spec | 21 ++++++++++++++++++++- sources | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/chromium.spec b/chromium.spec index 60a7f80..a6ed510 100644 --- a/chromium.spec +++ b/chromium.spec @@ -224,7 +224,7 @@ Name: chromium%{chromium_channel}%{nsuffix} %else Name: chromium%{chromium_channel} %endif -Version: %{majorversion}.0.4844.74 +Version: %{majorversion}.0.4844.84 Release: 1%{?dist} %if %{?freeworld} %if %{?shared} @@ -1712,15 +1712,21 @@ rm -rf %{buildroot} cp -a *.pak locales resources icudtl.dat %{buildroot}%{chromium_path} %ifarch x86_64 i686 aarch64 cp -a swiftshader %{buildroot}%{chromium_path} + strip %{buildroot}%{chromium_path}/swiftshader/libEGL.so + strip %{buildroot}%{chromium_path}/swiftshader/libGLESv2.so cp -a libvk_swiftshader.so* %{buildroot}%{chromium_path} + strip %{buildroot}%{chromium_path}/libvk_swiftshader.so cp -a libvulkan.so* %{buildroot}%{chromium_path} + strip %{buildroot}%{chromium_path}/libvulkan.so cp -a vk_swiftshader_icd.json %{buildroot}%{chromium_path} %endif cp -a chrome %{buildroot}%{chromium_path}/%{chromium_browser_channel} # Explicitly strip chromium-browser (since we don't use debuginfo here anyway) strip %{buildroot}%{chromium_path}/%{chromium_browser_channel} cp -a chrome_sandbox %{buildroot}%{chromium_path}/chrome-sandbox + strip %{buildroot}%{chromium_path}/chrome-sandbox cp -a chrome_crashpad_handler %{buildroot}%{chromium_path}/chrome_crashpad_handler + strip %{buildroot}%{chromium_path}/chrome_crashpad_handler cp -a ../../chrome/app/resources/manpage.1.in %{buildroot}%{_mandir}/man1/%{chromium_browser_channel}.1 sed -i "s|@@PACKAGE@@|%{chromium_browser_channel}|g" %{buildroot}%{_mandir}/man1/%{chromium_browser_channel}.1 sed -i "s|@@MENUNAME@@|%{chromium_menu_name}|g" %{buildroot}%{_mandir}/man1/%{chromium_browser_channel}.1 @@ -1732,6 +1738,8 @@ rm -rf %{buildroot} cp -a MEIPreload %{buildroot}%{chromium_path} # This is ANGLE, not to be confused with the similarly named files under swiftshader/ cp -a libEGL.so* libGLESv2.so* %{buildroot}%{chromium_path} + strip %{buildroot}%{chromium_path}/libEGL.so + strip %{buildroot}%{chromium_path}/libGLESv2.so %if %{build_clear_key_cdm} %ifarch i686 @@ -1747,6 +1755,7 @@ rm -rf %{buildroot} %endif %endif %endif + strip %{buildroot}%{chromium_path}/libclearkeycdm.so %endif %if 0%{?shared} @@ -1779,6 +1788,10 @@ rm -rf %{buildroot} %if %{build_remoting} pushd %{remotingbuilddir} + # Hey, there is a library now. + cp -a libremoting_core.so* %{buildroot}%{crd_path}/ + strip %{buildroot}%{crd_path}/libremoting_core.so + # See remoting/host/installer/linux/Makefile for logic cp -a remoting_native_messaging_host %{buildroot}%{crd_path}/native-messaging-host cp -a remote_assistance_host %{buildroot}%{crd_path}/remote-assistance-host @@ -2078,6 +2091,7 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %{crd_path}/chrome-remote-desktop %{crd_path}/chrome-remote-desktop-host %{crd_path}/is-remoting-session +%{crd_path}/libremoting_core.so* %if 0%{?shared} %{crd_path}/lib*.so %endif @@ -2115,6 +2129,11 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Sun Mar 27 2022 Tom Callaway - 99.0.4844.84-1 +- update to 99.0.4844.84 +- package up libremoting_core.so* for chrome-remote-desktop +- strip all the .so files (and binaries) + * Sat Mar 19 2022 Tom Callaway - 99.0.4844.74-1 - update to 99.0.4844.74 diff --git a/sources b/sources index e41ab3a..b28a43f 100644 --- a/sources +++ b/sources @@ -21,4 +21,4 @@ SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1d SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a SHA512 (node-v12.22.6-linux-arm64.tar.xz) = 87ce5eb954deb1d0debe6fa02b28a3cc675e12fca1e51d44b123ab294aa39ce0c6b8ac9eae1e7a6e32673ea2c2d480651d9ba7eea73012f0529503eebe9eb34d SHA512 (node-v12.22.6-linux-x64.tar.xz) = e1b55c32343cb2ccc40d888c705414bebf9c46b02083d13731df79b1e79521b7277761f6bcca041e40e3a2e47c67bb8e7848aa2b919a9de5c2ebf62c4a9c7176 -SHA512 (chromium-99.0.4844.74-clean.tar.xz) = 70df44fb6289977bd4a0b818b1d620ba2cca7da72d60ade8928eef6a5d822afd788d93cc169ff3b670addb62dd2ac7c5cf51d5698da5937caaf560a53a1b376c +SHA512 (chromium-99.0.4844.84-clean.tar.xz) = a442a7ff140ebec0831cb9bbaff0488ef77bb32a765e810c0d911cdf9d65fd9ac3e6e588a16ed1341d812582740651da1d62cfa632e134fbfae6df4a0e9a4cf4 From 19f000e61e526863fd8e5d1a5048d2d32ed25aaa Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Sun, 27 Mar 2022 10:01:51 -0400 Subject: [PATCH 082/659] fix f37 libusb BR --- chromium.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chromium.spec b/chromium.spec index a6ed510..fa72956 100644 --- a/chromium.spec +++ b/chromium.spec @@ -434,7 +434,11 @@ BuildRequires: libdrm-devel BuildRequires: libgcrypt-devel BuildRequires: libudev-devel BuildRequires: libuuid-devel +%if 0%{?fedora} >= 37 +BuildRequires: libusb-compat-0.1-devel +%else BuildRequires: libusb-devel +%endif BuildRequires: libXdamage-devel BuildRequires: libXtst-devel BuildRequires: xcb-proto From ef3cec3018be4d8d9ef90ec7bbf82a77a03f0a5c Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Mon, 28 Mar 2022 10:39:46 -0400 Subject: [PATCH 083/659] fix build against python3-markdownsafe 2.0.1, fix strip command to find proper libvulkan library --- ...m-99.0.4844.84-markdownsafe-soft_str.patch | 276 ++++++++++++++++++ chromium.spec | 10 +- 2 files changed, 285 insertions(+), 1 deletion(-) create mode 100644 chromium-99.0.4844.84-markdownsafe-soft_str.patch diff --git a/chromium-99.0.4844.84-markdownsafe-soft_str.patch b/chromium-99.0.4844.84-markdownsafe-soft_str.patch new file mode 100644 index 0000000..e2bf7dd --- /dev/null +++ b/chromium-99.0.4844.84-markdownsafe-soft_str.patch @@ -0,0 +1,276 @@ +diff -up chromium-99.0.4844.84/third_party/jinja2/filters.pyE.soft_str chromium-99.0.4844.84/third_party/jinja2/filters.pyE +--- chromium-99.0.4844.84/third_party/jinja2/filters.pyE.soft_str 2022-03-28 10:33:57.008665753 -0400 ++++ chromium-99.0.4844.84/third_party/jinja2/filters.pyE 2022-03-28 10:34:16.117784109 -0400 +@@ -10,7 +10,7 @@ from itertools import groupby + + from markupsafe import escape + from markupsafe import Markup +-from markupsafe import soft_unicode ++from markupsafe import soft_str + + from ._compat import abc + from ._compat import imap +@@ -191,18 +191,18 @@ def do_replace(eval_ctx, s, old, new, co + ): + s = escape(s) + else: +- s = soft_unicode(s) +- return s.replace(soft_unicode(old), soft_unicode(new), count) ++ s = soft_str(s) ++ return s.replace(soft_str(old), soft_str(new), count) + + + def do_upper(s): + """Convert a value to uppercase.""" +- return soft_unicode(s).upper() ++ return soft_str(s).upper() + + + def do_lower(s): + """Convert a value to lowercase.""" +- return soft_unicode(s).lower() ++ return soft_str(s).lower() + + + @evalcontextfilter +@@ -245,7 +245,7 @@ def do_capitalize(s): + """Capitalize a value. The first character will be uppercase, all others + lowercase. + """ +- return soft_unicode(s).capitalize() ++ return soft_str(s).capitalize() + + + def do_title(s): +@@ -255,7 +255,7 @@ def do_title(s): + return "".join( + [ + item[0].upper() + item[1:].lower() +- for item in _word_beginning_split_re.split(soft_unicode(s)) ++ for item in _word_beginning_split_re.split(soft_str(s)) + if item + ] + ) +@@ -495,7 +495,7 @@ def do_join(eval_ctx, value, d=u"", attr + return d.join(value) + + # no html involved, to normal joining +- return soft_unicode(d).join(imap(soft_unicode, value)) ++ return soft_str(d).join(imap(soft_str, value)) + + + def do_center(value, width=80): +@@ -761,7 +761,7 @@ def do_wordwrap( + + def do_wordcount(s): + """Count the words in that string.""" +- return len(_word_re.findall(soft_unicode(s))) ++ return len(_word_re.findall(soft_str(s))) + + + def do_int(value, default=0, base=10): +@@ -820,12 +820,12 @@ def do_format(value, *args, **kwargs): + raise FilterArgumentError( + "can't handle positional and keyword arguments at the same time" + ) +- return soft_unicode(value) % (kwargs or args) ++ return soft_str(value) % (kwargs or args) + + + def do_trim(value, chars=None): + """Strip leading and trailing characters, by default whitespace.""" +- return soft_unicode(value).strip(chars) ++ return soft_str(value).strip(chars) + + + def do_striptags(value): +@@ -1365,7 +1365,7 @@ FILTERS = { + "selectattr": do_selectattr, + "slice": do_slice, + "sort": do_sort, +- "string": soft_unicode, ++ "string": soft_str, + "striptags": do_striptags, + "sum": do_sum, + "title": do_title, +diff -up chromium-99.0.4844.84/third_party/jinja2/filters.py.soft_str chromium-99.0.4844.84/third_party/jinja2/filters.py +--- chromium-99.0.4844.84/third_party/jinja2/filters.py.soft_str 2022-03-28 10:33:14.979405438 -0400 ++++ chromium-99.0.4844.84/third_party/jinja2/filters.py 2022-03-28 10:33:45.934597164 -0400 +@@ -10,7 +10,7 @@ from itertools import groupby + + from markupsafe import escape + from markupsafe import Markup +-from markupsafe import soft_unicode ++from markupsafe import soft_str + + from ._compat import abc + from ._compat import imap +@@ -191,18 +191,18 @@ def do_replace(eval_ctx, s, old, new, co + ): + s = escape(s) + else: +- s = soft_unicode(s) +- return s.replace(soft_unicode(old), soft_unicode(new), count) ++ s = soft_str(s) ++ return s.replace(soft_str(old), soft_str(new), count) + + + def do_upper(s): + """Convert a value to uppercase.""" +- return soft_unicode(s).upper() ++ return soft_str(s).upper() + + + def do_lower(s): + """Convert a value to lowercase.""" +- return soft_unicode(s).lower() ++ return soft_str(s).lower() + + + @evalcontextfilter +@@ -245,7 +245,7 @@ def do_capitalize(s): + """Capitalize a value. The first character will be uppercase, all others + lowercase. + """ +- return soft_unicode(s).capitalize() ++ return soft_str(s).capitalize() + + + def do_title(s): +@@ -255,7 +255,7 @@ def do_title(s): + return "".join( + [ + item[0].upper() + item[1:].lower() +- for item in _word_beginning_split_re.split(soft_unicode(s)) ++ for item in _word_beginning_split_re.split(soft_str(s)) + if item + ] + ) +@@ -495,7 +495,7 @@ def do_join(eval_ctx, value, d=u"", attr + return d.join(value) + + # no html involved, to normal joining +- return soft_unicode(d).join(imap(soft_unicode, value)) ++ return soft_str(d).join(imap(soft_str, value)) + + + def do_center(value, width=80): +@@ -761,7 +761,7 @@ def do_wordwrap( + + def do_wordcount(s): + """Count the words in that string.""" +- return len(_word_re.findall(soft_unicode(s))) ++ return len(_word_re.findall(soft_str(s))) + + + def do_int(value, default=0, base=10): +@@ -820,12 +820,12 @@ def do_format(value, *args, **kwargs): + raise FilterArgumentError( + "can't handle positional and keyword arguments at the same time" + ) +- return soft_unicode(value) % (kwargs or args) ++ return soft_str(value) % (kwargs or args) + + + def do_trim(value, chars=None): + """Strip leading and trailing characters, by default whitespace.""" +- return soft_unicode(value).strip(chars) ++ return soft_str(value).strip(chars) + + + def do_striptags(value): +@@ -1365,7 +1365,7 @@ FILTERS = { + "selectattr": do_selectattr, + "slice": do_slice, + "sort": do_sort, +- "string": soft_unicode, ++ "string": soft_str, + "striptags": do_striptags, + "sum": do_sum, + "title": do_title, +diff -up chromium-99.0.4844.84/third_party/jinja2/runtime.pyE.soft_str chromium-99.0.4844.84/third_party/jinja2/runtime.pyE +--- chromium-99.0.4844.84/third_party/jinja2/runtime.pyE.soft_str 2022-03-28 10:36:38.053663222 -0400 ++++ chromium-99.0.4844.84/third_party/jinja2/runtime.pyE 2022-03-28 10:36:54.021762124 -0400 +@@ -6,7 +6,7 @@ from types import MethodType + + from markupsafe import escape # noqa: F401 + from markupsafe import Markup +-from markupsafe import soft_unicode ++from markupsafe import soft_str + + from ._compat import abc + from ._compat import imap +@@ -62,7 +62,7 @@ def identity(x): + def markup_join(seq): + """Concatenation that escapes if necessary and converts to unicode.""" + buf = [] +- iterator = imap(soft_unicode, seq) ++ iterator = imap(soft_str, seq) + for arg in iterator: + buf.append(arg) + if hasattr(arg, "__html__"): +diff -up chromium-99.0.4844.84/third_party/jinja2/runtime.py.soft_str chromium-99.0.4844.84/third_party/jinja2/runtime.py +--- chromium-99.0.4844.84/third_party/jinja2/runtime.py.soft_str 2022-03-28 10:36:17.301534689 -0400 ++++ chromium-99.0.4844.84/third_party/jinja2/runtime.py 2022-03-28 10:36:33.053632253 -0400 +@@ -6,7 +6,7 @@ from types import MethodType + + from markupsafe import escape # noqa: F401 + from markupsafe import Markup +-from markupsafe import soft_unicode ++from markupsafe import soft_str + + from ._compat import abc + from ._compat import imap +@@ -62,7 +62,7 @@ def identity(x): + def markup_join(seq): + """Concatenation that escapes if necessary and converts to unicode.""" + buf = [] +- iterator = imap(soft_unicode, seq) ++ iterator = imap(soft_str, seq) + for arg in iterator: + buf.append(arg) + if hasattr(arg, "__html__"): +diff -up chromium-99.0.4844.84/third_party/jinja2/utils.pyE.soft_str chromium-99.0.4844.84/third_party/jinja2/utils.pyE +--- chromium-99.0.4844.84/third_party/jinja2/utils.pyE.soft_str 2022-03-28 10:35:41.801314811 -0400 ++++ chromium-99.0.4844.84/third_party/jinja2/utils.pyE 2022-03-28 10:36:07.786475756 -0400 +@@ -725,13 +725,13 @@ except SyntaxError: + have_async_gen = False + + +-def soft_unicode(s): +- from markupsafe import soft_unicode ++def soft_str(s): ++ from markupsafe import soft_str + + warnings.warn( +- "'jinja2.utils.soft_unicode' will be removed in version 3.0." +- " Use 'markupsafe.soft_unicode' instead.", ++ "'jinja2.utils.soft_str' will be removed in version 3.0." ++ " Use 'markupsafe.soft_str' instead.", + DeprecationWarning, + stacklevel=2, + ) +- return soft_unicode(s) ++ return soft_str(s) +diff -up chromium-99.0.4844.84/third_party/jinja2/utils.py.soft_str chromium-99.0.4844.84/third_party/jinja2/utils.py +--- chromium-99.0.4844.84/third_party/jinja2/utils.py.soft_str 2022-03-28 10:34:29.063864294 -0400 ++++ chromium-99.0.4844.84/third_party/jinja2/utils.py 2022-03-28 10:35:31.555251349 -0400 +@@ -725,13 +725,13 @@ except SyntaxError: + have_async_gen = False + + +-def soft_unicode(s): +- from markupsafe import soft_unicode ++def soft_str(s): ++ from markupsafe import soft_str + + warnings.warn( +- "'jinja2.utils.soft_unicode' will be removed in version 3.0." +- " Use 'markupsafe.soft_unicode' instead.", ++ "'jinja2.utils.soft_str' will be removed in version 3.0." ++ " Use 'markupsafe.soft_str' instead.", + DeprecationWarning, + stacklevel=2, + ) +- return soft_unicode(s) ++ return soft_str(s) diff --git a/chromium.spec b/chromium.spec index fa72956..50fc05b 100644 --- a/chromium.spec +++ b/chromium.spec @@ -314,6 +314,11 @@ Patch84: chromium-94.0.4606.71-remoting-missing-cmath-header.patch # Clean up clang-format for python3 # thanks to Jon Nettleton Patch86: chromium-94.0.4606.81-clang-format.patch + +# Markdownsafe 2.0.1 removed soft_unicode (replaced with soft_str) +# This is only in Fedora 37+ +Patch87: chromium-99.0.4844.84-markdownsafe-soft_str.patch + # Fix extra qualification error Patch97: chromium-98.0.4758.80-remoting-extra-qualification.patch # From gentoo @@ -998,6 +1003,9 @@ udev. %patch82 -p1 -b .remoting-no-tests %patch84 -p1 -b .remoting-missing-cmath-header %patch86 -p1 -b .clang-format-py3 +%if 0%{?fedora} >= 37 +%patch87 -p1 -b .markdownsafe-soft_str +%endif %patch97 -p1 -b .remoting-extra-qualification %patch98 -p1 -b .InkDropHost-crash %patch99 -p1 -b .enable-WebRTCPipeWireCapturer-byDefault @@ -1721,7 +1729,7 @@ rm -rf %{buildroot} cp -a libvk_swiftshader.so* %{buildroot}%{chromium_path} strip %{buildroot}%{chromium_path}/libvk_swiftshader.so cp -a libvulkan.so* %{buildroot}%{chromium_path} - strip %{buildroot}%{chromium_path}/libvulkan.so + strip %{buildroot}%{chromium_path}/libvulkan.so.1 cp -a vk_swiftshader_icd.json %{buildroot}%{chromium_path} %endif cp -a chrome %{buildroot}%{chromium_path}/%{chromium_browser_channel} From c260145f10174ae230a6627c075b854dfeebbfde Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Mon, 28 Mar 2022 11:28:42 -0400 Subject: [PATCH 084/659] fix markdownsafe patch --- ...m-99.0.4844.84-markdownsafe-soft_str.patch | 138 ------------------ 1 file changed, 138 deletions(-) diff --git a/chromium-99.0.4844.84-markdownsafe-soft_str.patch b/chromium-99.0.4844.84-markdownsafe-soft_str.patch index e2bf7dd..b9ffc9b 100644 --- a/chromium-99.0.4844.84-markdownsafe-soft_str.patch +++ b/chromium-99.0.4844.84-markdownsafe-soft_str.patch @@ -1,98 +1,3 @@ -diff -up chromium-99.0.4844.84/third_party/jinja2/filters.pyE.soft_str chromium-99.0.4844.84/third_party/jinja2/filters.pyE ---- chromium-99.0.4844.84/third_party/jinja2/filters.pyE.soft_str 2022-03-28 10:33:57.008665753 -0400 -+++ chromium-99.0.4844.84/third_party/jinja2/filters.pyE 2022-03-28 10:34:16.117784109 -0400 -@@ -10,7 +10,7 @@ from itertools import groupby - - from markupsafe import escape - from markupsafe import Markup --from markupsafe import soft_unicode -+from markupsafe import soft_str - - from ._compat import abc - from ._compat import imap -@@ -191,18 +191,18 @@ def do_replace(eval_ctx, s, old, new, co - ): - s = escape(s) - else: -- s = soft_unicode(s) -- return s.replace(soft_unicode(old), soft_unicode(new), count) -+ s = soft_str(s) -+ return s.replace(soft_str(old), soft_str(new), count) - - - def do_upper(s): - """Convert a value to uppercase.""" -- return soft_unicode(s).upper() -+ return soft_str(s).upper() - - - def do_lower(s): - """Convert a value to lowercase.""" -- return soft_unicode(s).lower() -+ return soft_str(s).lower() - - - @evalcontextfilter -@@ -245,7 +245,7 @@ def do_capitalize(s): - """Capitalize a value. The first character will be uppercase, all others - lowercase. - """ -- return soft_unicode(s).capitalize() -+ return soft_str(s).capitalize() - - - def do_title(s): -@@ -255,7 +255,7 @@ def do_title(s): - return "".join( - [ - item[0].upper() + item[1:].lower() -- for item in _word_beginning_split_re.split(soft_unicode(s)) -+ for item in _word_beginning_split_re.split(soft_str(s)) - if item - ] - ) -@@ -495,7 +495,7 @@ def do_join(eval_ctx, value, d=u"", attr - return d.join(value) - - # no html involved, to normal joining -- return soft_unicode(d).join(imap(soft_unicode, value)) -+ return soft_str(d).join(imap(soft_str, value)) - - - def do_center(value, width=80): -@@ -761,7 +761,7 @@ def do_wordwrap( - - def do_wordcount(s): - """Count the words in that string.""" -- return len(_word_re.findall(soft_unicode(s))) -+ return len(_word_re.findall(soft_str(s))) - - - def do_int(value, default=0, base=10): -@@ -820,12 +820,12 @@ def do_format(value, *args, **kwargs): - raise FilterArgumentError( - "can't handle positional and keyword arguments at the same time" - ) -- return soft_unicode(value) % (kwargs or args) -+ return soft_str(value) % (kwargs or args) - - - def do_trim(value, chars=None): - """Strip leading and trailing characters, by default whitespace.""" -- return soft_unicode(value).strip(chars) -+ return soft_str(value).strip(chars) - - - def do_striptags(value): -@@ -1365,7 +1365,7 @@ FILTERS = { - "selectattr": do_selectattr, - "slice": do_slice, - "sort": do_sort, -- "string": soft_unicode, -+ "string": soft_str, - "striptags": do_striptags, - "sum": do_sum, - "title": do_title, diff -up chromium-99.0.4844.84/third_party/jinja2/filters.py.soft_str chromium-99.0.4844.84/third_party/jinja2/filters.py --- chromium-99.0.4844.84/third_party/jinja2/filters.py.soft_str 2022-03-28 10:33:14.979405438 -0400 +++ chromium-99.0.4844.84/third_party/jinja2/filters.py 2022-03-28 10:33:45.934597164 -0400 @@ -188,27 +93,6 @@ diff -up chromium-99.0.4844.84/third_party/jinja2/filters.py.soft_str chromium-9 "striptags": do_striptags, "sum": do_sum, "title": do_title, -diff -up chromium-99.0.4844.84/third_party/jinja2/runtime.pyE.soft_str chromium-99.0.4844.84/third_party/jinja2/runtime.pyE ---- chromium-99.0.4844.84/third_party/jinja2/runtime.pyE.soft_str 2022-03-28 10:36:38.053663222 -0400 -+++ chromium-99.0.4844.84/third_party/jinja2/runtime.pyE 2022-03-28 10:36:54.021762124 -0400 -@@ -6,7 +6,7 @@ from types import MethodType - - from markupsafe import escape # noqa: F401 - from markupsafe import Markup --from markupsafe import soft_unicode -+from markupsafe import soft_str - - from ._compat import abc - from ._compat import imap -@@ -62,7 +62,7 @@ def identity(x): - def markup_join(seq): - """Concatenation that escapes if necessary and converts to unicode.""" - buf = [] -- iterator = imap(soft_unicode, seq) -+ iterator = imap(soft_str, seq) - for arg in iterator: - buf.append(arg) - if hasattr(arg, "__html__"): diff -up chromium-99.0.4844.84/third_party/jinja2/runtime.py.soft_str chromium-99.0.4844.84/third_party/jinja2/runtime.py --- chromium-99.0.4844.84/third_party/jinja2/runtime.py.soft_str 2022-03-28 10:36:17.301534689 -0400 +++ chromium-99.0.4844.84/third_party/jinja2/runtime.py 2022-03-28 10:36:33.053632253 -0400 @@ -230,28 +114,6 @@ diff -up chromium-99.0.4844.84/third_party/jinja2/runtime.py.soft_str chromium-9 for arg in iterator: buf.append(arg) if hasattr(arg, "__html__"): -diff -up chromium-99.0.4844.84/third_party/jinja2/utils.pyE.soft_str chromium-99.0.4844.84/third_party/jinja2/utils.pyE ---- chromium-99.0.4844.84/third_party/jinja2/utils.pyE.soft_str 2022-03-28 10:35:41.801314811 -0400 -+++ chromium-99.0.4844.84/third_party/jinja2/utils.pyE 2022-03-28 10:36:07.786475756 -0400 -@@ -725,13 +725,13 @@ except SyntaxError: - have_async_gen = False - - --def soft_unicode(s): -- from markupsafe import soft_unicode -+def soft_str(s): -+ from markupsafe import soft_str - - warnings.warn( -- "'jinja2.utils.soft_unicode' will be removed in version 3.0." -- " Use 'markupsafe.soft_unicode' instead.", -+ "'jinja2.utils.soft_str' will be removed in version 3.0." -+ " Use 'markupsafe.soft_str' instead.", - DeprecationWarning, - stacklevel=2, - ) -- return soft_unicode(s) -+ return soft_str(s) diff -up chromium-99.0.4844.84/third_party/jinja2/utils.py.soft_str chromium-99.0.4844.84/third_party/jinja2/utils.py --- chromium-99.0.4844.84/third_party/jinja2/utils.py.soft_str 2022-03-28 10:34:29.063864294 -0400 +++ chromium-99.0.4844.84/third_party/jinja2/utils.py 2022-03-28 10:35:31.555251349 -0400 From 4db695eb291323c3d4c571f9578b0c6ddb0bfcd0 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Mon, 4 Apr 2022 08:32:43 +0100 Subject: [PATCH 085/659] drop the aarch64 issues that's fixes in binutils everwhere now (rhbz 1869884) --- chromium.spec | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/chromium.spec b/chromium.spec index 50fc05b..5c30a6e 100644 --- a/chromium.spec +++ b/chromium.spec @@ -58,9 +58,7 @@ # Practically, no. But it's here in case we do. %global use_gold 0 -# 2020-08-20: F33+ aarch64 has a binutils bug trying to link clear_key_cdm -# https://bugzilla.redhat.com/show_bug.cgi?id=1869884 -%global build_clear_key_cdm 1 +%global build_clear_key_cdm 0 # Since no one liked replacing just the media components, we do not build shared anymore. %global shared 0 From 09a0287d67998b67648b9115537333c603640fe1 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Thu, 7 Apr 2022 19:50:11 -0400 Subject: [PATCH 086/659] 100.0.4896.75 --- ...-100-GLImplementationParts-constexpr.patch | 92 +++++++++++ chromium-100-InMilliseconds-constexpr.patch | 97 ++++++++++++ chromium-100-SCTHashdanceMetadata-move.patch | 35 +++++ chromium-100-macro-typo.patch | 29 ++++ ....60-missing-utility-for-std-exchange.patch | 12 ++ ...0.0.4896.60-widevine-other-locations.patch | 20 +++ ...4896.75-remoting-extra-qualification.patch | 147 ++++++++++++++++++ chromium.spec | 40 +++-- clean_ffmpeg.sh | 5 + sources | 24 --- 10 files changed, 463 insertions(+), 38 deletions(-) create mode 100644 chromium-100-GLImplementationParts-constexpr.patch create mode 100644 chromium-100-InMilliseconds-constexpr.patch create mode 100644 chromium-100-SCTHashdanceMetadata-move.patch create mode 100644 chromium-100-macro-typo.patch create mode 100644 chromium-100.0.4896.60-missing-utility-for-std-exchange.patch create mode 100644 chromium-100.0.4896.60-widevine-other-locations.patch create mode 100644 chromium-100.0.4896.75-remoting-extra-qualification.patch delete mode 100644 sources diff --git a/chromium-100-GLImplementationParts-constexpr.patch b/chromium-100-GLImplementationParts-constexpr.patch new file mode 100644 index 0000000..437e672 --- /dev/null +++ b/chromium-100-GLImplementationParts-constexpr.patch @@ -0,0 +1,92 @@ +From d32156fd3773330eca99e9cba5e18db57aaa1a53 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Sat, 19 Feb 2022 10:14:24 +0000 +Subject: [PATCH] GCC: make GLImplementationParts constructors constexpr + +Fix build error in GCC, as the constexpr operator== requires its +invocations to be also constexpr. +--- + ui/gl/gl_implementation.cc | 23 ----------------------- + ui/gl/gl_implementation.h | 25 +++++++++++++++++++++++-- + 2 files changed, 23 insertions(+), 25 deletions(-) + +diff --git a/ui/gl/gl_implementation.cc b/ui/gl/gl_implementation.cc +index e4e5456..3e4a47c 100644 +--- a/ui/gl/gl_implementation.cc ++++ b/ui/gl/gl_implementation.cc +@@ -26,29 +26,6 @@ + + namespace gl { + +-ANGLEImplementation MakeANGLEImplementation( +- const GLImplementation gl_impl, +- const ANGLEImplementation angle_impl) { +- if (gl_impl == kGLImplementationEGLANGLE) { +- if (angle_impl == ANGLEImplementation::kNone) { +- return ANGLEImplementation::kDefault; +- } else { +- return angle_impl; +- } +- } else { +- return ANGLEImplementation::kNone; +- } +-} +- +-GLImplementationParts::GLImplementationParts( +- const ANGLEImplementation angle_impl) +- : gl(kGLImplementationEGLANGLE), +- angle(MakeANGLEImplementation(kGLImplementationEGLANGLE, angle_impl)) {} +- +-GLImplementationParts::GLImplementationParts(const GLImplementation gl_impl) +- : gl(gl_impl), +- angle(MakeANGLEImplementation(gl_impl, ANGLEImplementation::kDefault)) {} +- + bool GLImplementationParts::IsValid() const { + if (angle == ANGLEImplementation::kNone) { + return (gl != kGLImplementationEGLANGLE); +diff --git a/ui/gl/gl_implementation.h b/ui/gl/gl_implementation.h +index 376ed58..a2513ea 100644 +--- a/ui/gl/gl_implementation.h ++++ b/ui/gl/gl_implementation.h +@@ -59,8 +59,14 @@ enum class ANGLEImplementation { + }; + + struct GL_EXPORT GLImplementationParts { +- explicit GLImplementationParts(const ANGLEImplementation angle_impl); +- explicit GLImplementationParts(const GLImplementation gl_impl); ++ constexpr explicit GLImplementationParts(const ANGLEImplementation angle_impl) ++ : gl(kGLImplementationEGLANGLE), ++ angle(MakeANGLEImplementation(kGLImplementationEGLANGLE, angle_impl)) {} ++ ++ constexpr explicit GLImplementationParts(const GLImplementation gl_impl) ++ : gl(gl_impl), ++ angle(MakeANGLEImplementation(gl_impl, ANGLEImplementation::kDefault)) { ++ } + + GLImplementation gl = kGLImplementationNone; + ANGLEImplementation angle = ANGLEImplementation::kNone; +@@ -80,6 +86,21 @@ struct GL_EXPORT GLImplementationParts { + bool IsValid() const; + bool IsAllowed(const std::vector& allowed_impls) const; + std::string ToString() const; ++ ++ private: ++ constexpr ANGLEImplementation MakeANGLEImplementation( ++ const GLImplementation gl_impl, ++ const ANGLEImplementation angle_impl) { ++ if (gl_impl == kGLImplementationEGLANGLE) { ++ if (angle_impl == ANGLEImplementation::kNone) { ++ return ANGLEImplementation::kDefault; ++ } else { ++ return angle_impl; ++ } ++ } else { ++ return ANGLEImplementation::kNone; ++ } ++ } + }; + + struct GL_EXPORT GLWindowSystemBindingInfo { +-- +2.34.1 + diff --git a/chromium-100-InMilliseconds-constexpr.patch b/chromium-100-InMilliseconds-constexpr.patch new file mode 100644 index 0000000..cf4562a --- /dev/null +++ b/chromium-100-InMilliseconds-constexpr.patch @@ -0,0 +1,97 @@ +From da6e3f6071fdabeb96c0805626418414b4a4cea8 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Wed, 9 Feb 2022 17:56:21 +0000 +Subject: [PATCH] GCC: make base::InMilliseconds(F,RoundedUp) constexpr + +media::DecodeTimestamp uses it in several constexpr methods. +--- + base/time/time.cc | 24 ------------------------ + base/time/time.h | 30 +++++++++++++++++++++++++++--- + 2 files changed, 27 insertions(+), 27 deletions(-) + +diff --git a/base/time/time.cc b/base/time/time.cc +index 0de273e..e0acda2 100644 +--- a/base/time/time.cc ++++ b/base/time/time.cc +@@ -74,30 +74,6 @@ int TimeDelta::InDaysFloored() const { + : std::numeric_limits::max(); + } + +-double TimeDelta::InMillisecondsF() const { +- if (!is_inf()) +- return static_cast(delta_) / Time::kMicrosecondsPerMillisecond; +- return (delta_ < 0) ? -std::numeric_limits::infinity() +- : std::numeric_limits::infinity(); +-} +- +-int64_t TimeDelta::InMilliseconds() const { +- if (!is_inf()) +- return delta_ / Time::kMicrosecondsPerMillisecond; +- return (delta_ < 0) ? std::numeric_limits::min() +- : std::numeric_limits::max(); +-} +- +-int64_t TimeDelta::InMillisecondsRoundedUp() const { +- if (!is_inf()) { +- const int64_t result = delta_ / Time::kMicrosecondsPerMillisecond; +- // Convert |result| from truncating to ceiling. +- return (delta_ > result * Time::kMicrosecondsPerMillisecond) ? (result + 1) +- : result; +- } +- return delta_; +-} +- + double TimeDelta::InMicrosecondsF() const { + if (!is_inf()) + return static_cast(delta_); +diff --git a/base/time/time.h b/base/time/time.h +index c027aab..fb1d78d 100644 +--- a/base/time/time.h ++++ b/base/time/time.h +@@ -216,9 +216,9 @@ class BASE_EXPORT TimeDelta { + constexpr int InMinutes() const; + constexpr double InSecondsF() const; + constexpr int64_t InSeconds() const; +- double InMillisecondsF() const; +- int64_t InMilliseconds() const; +- int64_t InMillisecondsRoundedUp() const; ++ constexpr double InMillisecondsF() const; ++ constexpr int64_t InMilliseconds() const; ++ constexpr int64_t InMillisecondsRoundedUp() const; + constexpr int64_t InMicroseconds() const { return delta_; } + double InMicrosecondsF() const; + constexpr int64_t InNanoseconds() const; +@@ -889,6 +889,30 @@ constexpr int64_t TimeDelta::InSeconds() const { + return is_inf() ? delta_ : (delta_ / Time::kMicrosecondsPerSecond); + } + ++constexpr double TimeDelta::InMillisecondsF() const { ++ if (!is_inf()) ++ return static_cast(delta_) / Time::kMicrosecondsPerMillisecond; ++ return (delta_ < 0) ? -std::numeric_limits::infinity() ++ : std::numeric_limits::infinity(); ++} ++ ++constexpr int64_t TimeDelta::InMilliseconds() const { ++ if (!is_inf()) ++ return delta_ / Time::kMicrosecondsPerMillisecond; ++ return (delta_ < 0) ? std::numeric_limits::min() ++ : std::numeric_limits::max(); ++} ++ ++constexpr int64_t TimeDelta::InMillisecondsRoundedUp() const { ++ if (!is_inf()) { ++ const int64_t result = delta_ / Time::kMicrosecondsPerMillisecond; ++ // Convert |result| from truncating to ceiling. ++ return (delta_ > result * Time::kMicrosecondsPerMillisecond) ? (result + 1) ++ : result; ++ } ++ return delta_; ++} ++ + constexpr int64_t TimeDelta::InNanoseconds() const { + return base::ClampMul(delta_, Time::kNanosecondsPerMicrosecond); + } +-- +2.34.1 + diff --git a/chromium-100-SCTHashdanceMetadata-move.patch b/chromium-100-SCTHashdanceMetadata-move.patch new file mode 100644 index 0000000..9039429 --- /dev/null +++ b/chromium-100-SCTHashdanceMetadata-move.patch @@ -0,0 +1,35 @@ +From 364dc0067d1c20c7a2d21277a7ec0c4419d9bc11 Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz +Date: Wed, 23 Feb 2022 12:18:57 +0100 +Subject: [PATCH] GCC: explicitely move return value of SCTHashdanceMetadata::ToValue + +GCC rejects to do Return Value Optimization in +SCTHashdanceMetadata::ToValue, because the copy constructor is +deleted, and in that scenario RVO is rejected in GCC: + ../../services/network/sct_auditing/sct_auditing_reporter.cc: In member function ‘base::Value network::SCTAuditingReporter::SCTHashdanceMetadata::ToValue() const’: + ../../services/network/sct_auditing/sct_auditing_reporter.cc:191:10: error: use of deleted function ‘base::Value::Value(const base::Value&)’ + 191 | return value; + | ^~~~~ + In file included from ../../services/network/sct_auditing/sct_auditing_reporter.h:14, + from ../../services/network/sct_auditing/sct_auditing_reporter.cc:5: + ../../base/values.h:254:3: note: declared here + 254 | Value(const Value&) = delete; + | ^~~~~ + +Bug: 819294 +Change-Id: I111e51dd10eee7b909d4ac3c0911aac18a589166 +--- + +diff --git a/services/network/sct_auditing/sct_auditing_reporter.cc b/services/network/sct_auditing/sct_auditing_reporter.cc +index a057e8e..365527b 100644 +--- a/services/network/sct_auditing/sct_auditing_reporter.cc ++++ b/services/network/sct_auditing/sct_auditing_reporter.cc +@@ -188,7 +188,7 @@ + kLogIdKey, base::Base64Encode(base::as_bytes(base::make_span(log_id)))); + value.SetKey(kLogMMDKey, base::TimeDeltaToValue(log_mmd)); + value.SetKey(kCertificateExpiry, base::TimeToValue(certificate_expiry)); +- return value; ++ return std::move(value); + } + + // static diff --git a/chromium-100-macro-typo.patch b/chromium-100-macro-typo.patch new file mode 100644 index 0000000..833f869 --- /dev/null +++ b/chromium-100-macro-typo.patch @@ -0,0 +1,29 @@ +From 1183b14db8bd08d731ff3433c436887de00be3aa Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz +Date: Fri, 18 Feb 2022 16:28:25 +0000 +Subject: [PATCH] Fix typo in non-clang GSL_OWNER macro + +GCC build fails because GSL_OWNER is not defined (GSL_OWNER_ was +the one actually declared). + +Bug: 819294 +Change-Id: I1c3d17cb1c08b9bc0e8a888452da9868c308ddb5 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3472080 +Reviewed-by: Daniel Cheng +Commit-Queue: Daniel Cheng +Cr-Commit-Position: refs/heads/main@{#972974} +--- + +diff --git a/base/compiler_specific.h b/base/compiler_specific.h +index eec5810..1ee8074 100644 +--- a/base/compiler_specific.h ++++ b/base/compiler_specific.h +@@ -386,7 +386,7 @@ + #define GSL_OWNER [[gsl::Owner]] + #define GSL_POINTER [[gsl::Pointer]] + #else +-#define GSL_OWNER_ ++#define GSL_OWNER + #define GSL_POINTER + #endif + diff --git a/chromium-100.0.4896.60-missing-utility-for-std-exchange.patch b/chromium-100.0.4896.60-missing-utility-for-std-exchange.patch new file mode 100644 index 0000000..0bcd6c0 --- /dev/null +++ b/chromium-100.0.4896.60-missing-utility-for-std-exchange.patch @@ -0,0 +1,12 @@ +diff -up chromium-98.0.4758.102/base/third_party/symbolize/symbolize.h.missing-utility-for-std-exchange chromium-98.0.4758.102/base/third_party/symbolize/symbolize.h +--- chromium-98.0.4758.102/base/third_party/symbolize/symbolize.h.missing-utility-for-std-exchange 2022-02-25 22:30:02.833745309 +0000 ++++ chromium-98.0.4758.102/base/third_party/symbolize/symbolize.h 2022-02-25 22:30:02.832745344 +0000 +@@ -58,6 +58,8 @@ + #include "config.h" + #include "glog/logging.h" + ++#include ++ + #ifdef HAVE_SYMBOLIZE + + #include diff --git a/chromium-100.0.4896.60-widevine-other-locations.patch b/chromium-100.0.4896.60-widevine-other-locations.patch new file mode 100644 index 0000000..a123b27 --- /dev/null +++ b/chromium-100.0.4896.60-widevine-other-locations.patch @@ -0,0 +1,20 @@ +diff -up chromium-100.0.4896.60/chrome/common/chrome_paths.cc.widevine-other-locations chromium-100.0.4896.60/chrome/common/chrome_paths.cc +--- chromium-100.0.4896.60/chrome/common/chrome_paths.cc.widevine-other-locations 2022-04-02 15:48:56.944051789 +0000 ++++ chromium-100.0.4896.60/chrome/common/chrome_paths.cc 2022-04-02 15:52:34.825642103 +0000 +@@ -319,6 +319,16 @@ bool PathProvider(int key, base::FilePat + + #if BUILDFLAG(ENABLE_WIDEVINE) + case chrome::DIR_BUNDLED_WIDEVINE_CDM: ++ base::PathService::Get(base::DIR_HOME, &cur); ++ cur = cur.Append(FILE_PATH_LITERAL(".local/lib/libwidevinecdm.so")); ++ if (base::PathExists(cur)) { ++ break; ++ } ++ // Yes, this has an arch hardcoded in the path, but at this time, it is the only place to find libwidevinecdm.so ++ if (base::PathExists(base::FilePath(FILE_PATH_LITERAL("/opt/google/chrome/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so")))) { ++ cur = base::FilePath(FILE_PATH_LITERAL("/opt/google/chrome/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so")); ++ break; ++ } + if (!GetComponentDirectory(&cur)) + return false; + cur = cur.AppendASCII(kWidevineCdmBaseDirectory); diff --git a/chromium-100.0.4896.75-remoting-extra-qualification.patch b/chromium-100.0.4896.75-remoting-extra-qualification.patch new file mode 100644 index 0000000..9d4b625 --- /dev/null +++ b/chromium-100.0.4896.75-remoting-extra-qualification.patch @@ -0,0 +1,147 @@ +diff -up chromium-100.0.4896.75/remoting/host/mojom/remoting_mojom_traits.h.remoting-extra-qualification chromium-100.0.4896.75/remoting/host/mojom/remoting_mojom_traits.h +--- chromium-100.0.4896.75/remoting/host/mojom/remoting_mojom_traits.h.remoting-extra-qualification 2022-04-05 20:02:25.525814644 +0000 ++++ chromium-100.0.4896.75/remoting/host/mojom/remoting_mojom_traits.h 2022-04-07 13:35:28.490655471 +0000 +@@ -30,7 +30,7 @@ + namespace mojo { + + template <> +-class mojo::StructTraits { ++class StructTraits { + public: + static bool value(bool value) { return value; } + +@@ -41,7 +41,7 @@ class mojo::StructTraits +-class mojo::StructTraits { ++class StructTraits { + public: + static float value(float value) { return value; } + +@@ -52,7 +52,7 @@ class mojo::StructTraits +-class mojo::StructTraits { ++class StructTraits { + public: + static int32_t value(int32_t value) { return value; } + +@@ -64,7 +64,7 @@ class mojo::StructTraits +-class mojo::StructTraits { ++class StructTraits { + public: + static uint32_t value(uint32_t value) { return value; } + +@@ -76,7 +76,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static bool use_update_notifications( +@@ -101,7 +101,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static bool enable_curtaining( +@@ -161,7 +161,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static int32_t width(const ::webrtc::DesktopSize& size) { +@@ -177,7 +177,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static int32_t x(const ::webrtc::DesktopVector& vector) { return vector.x(); } +@@ -243,7 +243,7 @@ struct EnumTraits +-class mojo::StructTraits { + public: + static const std::string& mime_type( +@@ -261,7 +261,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static bool pressed(const ::remoting::protocol::KeyEvent& event) { +@@ -297,7 +297,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static absl::optional x( +@@ -386,7 +386,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static const ::webrtc::DesktopSize& dimensions( +@@ -404,7 +404,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static const std::string& text(const ::remoting::protocol::TextEvent& event) { +@@ -416,7 +416,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static uint32_t id(const ::remoting::protocol::TouchEventPoint& event) { +@@ -493,7 +493,7 @@ struct EnumTraits +-class mojo::StructTraits { + public: + static ::remoting::protocol::TouchEvent::TouchEventType event_type( +@@ -553,7 +553,7 @@ struct EnumTraits +-class mojo::StructTraits { + public: + static ::remoting::protocol::TransportRoute::RouteType type( diff --git a/chromium.spec b/chromium.spec index 50fc05b..7d8aa71 100644 --- a/chromium.spec +++ b/chromium.spec @@ -217,14 +217,14 @@ BuildRequires: libicu-devel >= 5.4 %global chromoting_client_id %nil %endif -%global majorversion 99 +%global majorversion 100 %if %{freeworld} Name: chromium%{chromium_channel}%{nsuffix} %else Name: chromium%{chromium_channel} %endif -Version: %{majorversion}.0.4844.84 +Version: %{majorversion}.0.4896.75 Release: 1%{?dist} %if %{?freeworld} %if %{?shared} @@ -257,10 +257,8 @@ Patch6: chromium-95.0.4638.69-norar.patch # Use Gentoo's Widevine hack # https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/files/chromium-widevine-r3.patch Patch7: chromium-71.0.3578.98-widevine-r3.patch -# drop rsp clobber, which breaks gcc9 (thanks to Jeff Law) -Patch9: chromium-94.0.4606.54-gcc9-drop-rsp-clobber.patch # Try to load widevine from other places -Patch10: chromium-92.0.4515.107-widevine-other-locations.patch +Patch10: chromium-100.0.4896.60-widevine-other-locations.patch # Tell bootstrap.py to always use the version of Python we specify %if 0%{?build_with_python3} Patch11: chromium-93.0.4577.63-py3-bootstrap.patch @@ -283,8 +281,14 @@ Patch57: chromium-96.0.4664.45-missing-cstring.patch # prepare for using system ffmpeg (clean) # http://svnweb.mageia.org/packages/cauldron/chromium-browser-stable/current/SOURCES/chromium-53-ffmpeg-no-deprecation-errors.patch?view=markup Patch58: chromium-53-ffmpeg-no-deprecation-errors.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-99-AutofillAssistantModelExecutor-NoDestructor.patch -Patch60: chromium-99-AutofillAssistantModelExecutor-NoDestructor.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-100-GLImplementationParts-constexpr.patch +Patch60: chromium-100-GLImplementationParts-constexpr.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-100-InMilliseconds-constexpr.patch +Patch61: chromium-100-InMilliseconds-constexpr.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-100-macro-typo.patch +Patch62: chromium-100-macro-typo.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-100-SCTHashdanceMetadata-move.patch +Patch63: chromium-100-SCTHashdanceMetadata-move.patch # Extra CXXFLAGS for aarch64 Patch64: chromium-91.0.4472.77-aarch64-cxxflags-addition.patch # Fix issue where closure_compiler thinks java is only allowed in android builds @@ -320,13 +324,13 @@ Patch86: chromium-94.0.4606.81-clang-format.patch Patch87: chromium-99.0.4844.84-markdownsafe-soft_str.patch # Fix extra qualification error -Patch97: chromium-98.0.4758.80-remoting-extra-qualification.patch +Patch97: chromium-100.0.4896.75-remoting-extra-qualification.patch # From gentoo Patch98: chromium-94.0.4606.71-InkDropHost-crash.patch # Enable WebRTCPPipeWireCapturer by default Patch99: chromium-96.0.4664.110-enable-WebRTCPipeWireCapturer-byDefault.patch # Add include for std::exchange -Patch100: chromium-98.0.4758.80-missing-utility-for-std-exchange.patch +Patch100: chromium-100.0.4896.60-missing-utility-for-std-exchange.patch # Use lstdc++ on EPEL7 only @@ -977,7 +981,6 @@ udev. %patch5 -p1 -b .nozlibmangle %patch6 -p1 -b .nounrar %patch7 -p1 -b .widevine-hack -%patch9 -p1 -b .gcc9 %patch10 -p1 -b .widevine-other-locations %if 0%{?build_with_python3} %patch11 -p1 -b .py3 @@ -992,7 +995,10 @@ udev. %patch56 -p1 -b .missing-cstdint %patch57 -p1 -b .missing-cstring %patch58 -p1 -b .ffmpeg-deprecations -%patch60 -p1 -b .AutofillAssistantModelExecutor-NoDestructor +%patch60 -p1 -b .GLImplementationParts-constexpr +%patch61 -p1 -b .InMilliseconds-constexpr +%patch62 -p1 -b .macro-typo +%patch63 -p1 -b .SCTHashdanceMetadata-move %patch64 -p1 -b .aarch64-cxxflags-addition %patch65 -p1 -b .java-only-allowed %patch67 -p1 -b .remoting-cstring @@ -1463,7 +1469,6 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/swiftshader/third_party/marl' \ 'third_party/swiftshader/third_party/subzero' \ 'third_party/swiftshader/third_party/SPIRV-Headers' \ - 'third_party/tcmalloc' \ 'third_party/tensorflow-text' \ 'third_party/test_fonts' \ 'third_party/tflite' \ @@ -1841,7 +1846,7 @@ rm -rf %{buildroot} %if %{build_headless} pushd %{headlessbuilddir} - cp -a headless_lib.pak headless_shell %{buildroot}%{chromium_path} + cp -a headless_lib_data.pak headless_lib_strings.pak headless_shell %{buildroot}%{chromium_path} # Explicitly strip headless_shell binary strip %{buildroot}%{chromium_path}/headless_shell popd @@ -2005,7 +2010,8 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %files common %if %{build_headless} -%{chromium_path}/headless_lib.pak +%{chromium_path}/headless_lib_data.pak +%{chromium_path}/headless_lib_strings.pak %endif %if %{build_clear_key_cdm} %{chromium_path}/libclearkeycdm.so @@ -2141,6 +2147,12 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Tue Apr 25 2022 Tom Callaway - 100.0.4896.75-1 +- update to 100.0.4896.75 + +* Sat Apr 2 2022 Tom Callaway - 100.0.4896.60-1 +- update to 100.0.4896.60 + * Sun Mar 27 2022 Tom Callaway - 99.0.4844.84-1 - update to 99.0.4844.84 - package up libremoting_core.so* for chrome-remote-desktop diff --git a/clean_ffmpeg.sh b/clean_ffmpeg.sh index 60a40b4..2055fdc 100755 --- a/clean_ffmpeg.sh +++ b/clean_ffmpeg.sh @@ -56,6 +56,7 @@ fi generated_files_headers="$generated_files_headers ${generated_files//.asm/.h}" header_files=" libavcodec/x86/inline_asm.h \ + libavcodec/x86/hpeldsp.h \ libavcodec/x86/mathops.h \ libavcodec/x86/vp56_arith.h \ libavcodec/aarch64/vp8dsp.h \ @@ -218,6 +219,7 @@ manual_files=" libavcodec/aarch64/fft_neon.S \ libavcodec/aarch64/neon.S \ libavcodec/aarch64/vorbisdsp_neon.S \ libavcodec/aarch64/vp8dsp_neon.S \ + libavcodec/x86/hpeldsp.asm \ libavcodec/x86/hpeldsp_rnd_template.c \ libavcodec/x86/mdct15.asm \ libavcodec/x86/mdct15_init.c \ @@ -225,6 +227,8 @@ manual_files=" libavcodec/aarch64/fft_neon.S \ libavcodec/x86/videodsp.asm \ libavcodec/x86/videodsp_init.c \ libavcodec/x86/vorbisdsp_init.c \ + libavcodec/x86/vp3dsp.asm \ + libavcodec/x86/vp8dsp.asm \ libavcodec/autorename_libavcodec_mdct15.c \ libavcodec/bit_depth_template.c \ libavcodec/fft_template.c \ @@ -246,6 +250,7 @@ manual_files=" libavcodec/aarch64/fft_neon.S \ libavcodec/vorbisdsp.c \ libavcodec/vp3dsp.c \ libavcodec/vp8dsp.c \ + libavformat/flacdec.c \ libavformat/options.c \ libavformat/pcm.c \ libavformat/utils.c \ diff --git a/sources b/sources deleted file mode 100644 index b28a43f..0000000 --- a/sources +++ /dev/null @@ -1,24 +0,0 @@ -SHA512 (gelasio.zip) = 0a22def3eca8848161ee72453dc5f97cc52ed09ffe21834152f2535d3a71f404cdf1f6e1809564bacb86aae75278cbcb96cae52b537d3ccdc299b60d6d0bc53e -SHA512 (MuktiNarrow-0.94.tar.bz2) = f7abd429e2591eaa047d1ac982d97fa67dc1480c42e55b2a97861abd90918704dce90b6bb27dec7b6d696f188017a74de54a7b7f45281f0515923b90300959d1 -SHA512 (NotoSansCJKjp-hinted.zip) = e7bcbc53a10b8ec3679dcade5a8a94cea7e1f60875ab38f2193b4fa8e33968e1f0abc8184a3df1e5210f6f5c731f96c727c6aa8f519423a29707d2dee5ada193 -SHA512 (lohit-gurmukhi-ttf-2.91.2.tar.gz) = 714ed72d201e7f8956d24e9d9f1526207beb91a604e88c02a8b0d145f19d9bfe1408ca290d1665ebef462ab3854365dcd9850529803277738e2585addf3e280a -SHA512 (Arimo-BoldItalic.ttf) = cb1f411f2630f2754dfb0244b3c56fde43650d603512d47c143bc0f24028da4d7ca2b35a633226ef9c502b97c63cfbd5a6d696934b3e60b2a98ad879b113a4c4 -SHA512 (Arimo-Bold.ttf) = 2853e5f41e6899baf226db2578aba09f2f88085eaea02da024621492d21e1af8bdefdefd354ea23dc4d5de5cb0d554085040a0108820f213e86dd532986fdb41 -SHA512 (Arimo-Italic.ttf) = 56ef918e5811dcd375e6cd8d79dc69f4db75d544639c0f6ac3a0343b3b4ef94b7dee5a6066f1558d8747a32bbee074256be68b943ff31cfbd2f5f32acfa7c1c5 -SHA512 (Arimo-Regular.ttf) = 05e6aa6b785b0038a8e0e0a8a618a1b8e907a700be302148eaebc91cfac3c9e2d9acf90b9d077ff3b9ff54bd5f8a9c522a039cff6103cdeee54be29b6a0b355f -SHA512 (Cousine-BoldItalic.ttf) = 2125aa9f5db4ae4a3725d308b6afbfbce5957f3c96a3c5fcba8ebf5cd167017d9c7023391e947ed68d12fa97e2cba3f156a3acca276d9f5ed50df7d78c07f918 -SHA512 (Cousine-Bold.ttf) = 1759fd23419ae0e1bfc9be92abb9cb0c74084ce85e7f53c055d86ec3d62da83169d0d67ed96fd4e496b28acf382933d63448459108b109d8202db7f18f05caab -SHA512 (Cousine-Italic.ttf) = ec3fc9d940b748dbbc64aa66184413a78ae2b085181eed563449df044b891e951e8feebd865be5be42f0cd001acf5bdce9084a006f9b5be32f096f7df0dc7700 -SHA512 (Cousine-Regular.ttf) = a665a6a4a5583079eb87509e2da7d6bd06965e6a7655217302b088caef942ae9ad63e6cffda18d0001fc9ab2284836766843e46bfdacd188b54f39d7855f36a0 -SHA512 (Tinos-BoldItalic.ttf) = 2574de2add94ef976b731fac688951fab49574c9b0ccd259ba647ea3598ca026bcfb88e2ea3f19effb3af71fdc0eb5fa9973f0b6e996c22185c5f2aab5a23fdd -SHA512 (Tinos-Bold.ttf) = 54aeca804c06a4d5c57ade596e73df91a6a1c4401c4aadba55d987b3fb73045d35f3df02678b59abb77c4914ec741755536c0adf808c931e4b77848c52c229c4 -SHA512 (Tinos-Italic.ttf) = d4f4f096110ef98a781a2a0e0d319317e5f84e650fe6f4d4f6b0e22a16414278217f37497b904a18540273c0e2d79d4f1faabde3b0eb5446283b318c73bafb38 -SHA512 (Tinos-Regular.ttf) = 58085c5dac6d067d60ba2ab3220c4a0cc1efcf279cadfcfb8746a5e5fa1a6f6daa62750dc2051b3b2d8a51b4d2e9bb0f66594caf2253c0870ed9c7286fa45e8f -SHA512 (Ahem.ttf) = aeb64b10ab9c87860714cb60b4900254b13dc52c51319256a1a3722c882026ab7c616bf628fbc2fe14e38a6003f3a481af60b52a7ed62071d28ddaf428e4e3fd -SHA512 (xcb-proto-1.14.tar.xz) = de66d568163b6da2be9d6c59984f3afa3acd119a781378638045fd68018665ef5c9af98f024e9962ba3eb7c7a4d85c27ba70ffafceb2324ccc6940f34de16690 -SHA512 (depot_tools.git-master.tar.gz) = dc323888812b66cc92c53a24a8a58ccf9e2961be67aa21852bd091b8b49569071f06ae9104cb58950e6253ac3a29f0db0663e9f35ef2b1ea28696efb38b42708 -SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1dc09f5a0fd7898e9d0a372ee4422b6b1cdab3c86ecc91db437e9ae8a951e64e85edc3ac9e9fca428852dbb2ad -SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a -SHA512 (node-v12.22.6-linux-arm64.tar.xz) = 87ce5eb954deb1d0debe6fa02b28a3cc675e12fca1e51d44b123ab294aa39ce0c6b8ac9eae1e7a6e32673ea2c2d480651d9ba7eea73012f0529503eebe9eb34d -SHA512 (node-v12.22.6-linux-x64.tar.xz) = e1b55c32343cb2ccc40d888c705414bebf9c46b02083d13731df79b1e79521b7277761f6bcca041e40e3a2e47c67bb8e7848aa2b919a9de5c2ebf62c4a9c7176 -SHA512 (chromium-99.0.4844.84-clean.tar.xz) = a442a7ff140ebec0831cb9bbaff0488ef77bb32a765e810c0d911cdf9d65fd9ac3e6e588a16ed1341d812582740651da1d62cfa632e134fbfae6df4a0e9a4cf4 From 13b814a4355a2627c065dd2ab038a822a03af99d Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Thu, 7 Apr 2022 19:53:00 -0400 Subject: [PATCH 087/659] 100.0.4896.75 --- sources | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 sources diff --git a/sources b/sources new file mode 100644 index 0000000..fe0b96d --- /dev/null +++ b/sources @@ -0,0 +1,24 @@ +SHA512 (gelasio.zip) = 0a22def3eca8848161ee72453dc5f97cc52ed09ffe21834152f2535d3a71f404cdf1f6e1809564bacb86aae75278cbcb96cae52b537d3ccdc299b60d6d0bc53e +SHA512 (MuktiNarrow-0.94.tar.bz2) = f7abd429e2591eaa047d1ac982d97fa67dc1480c42e55b2a97861abd90918704dce90b6bb27dec7b6d696f188017a74de54a7b7f45281f0515923b90300959d1 +SHA512 (NotoSansCJKjp-hinted.zip) = e7bcbc53a10b8ec3679dcade5a8a94cea7e1f60875ab38f2193b4fa8e33968e1f0abc8184a3df1e5210f6f5c731f96c727c6aa8f519423a29707d2dee5ada193 +SHA512 (lohit-gurmukhi-ttf-2.91.2.tar.gz) = 714ed72d201e7f8956d24e9d9f1526207beb91a604e88c02a8b0d145f19d9bfe1408ca290d1665ebef462ab3854365dcd9850529803277738e2585addf3e280a +SHA512 (Arimo-BoldItalic.ttf) = cb1f411f2630f2754dfb0244b3c56fde43650d603512d47c143bc0f24028da4d7ca2b35a633226ef9c502b97c63cfbd5a6d696934b3e60b2a98ad879b113a4c4 +SHA512 (Arimo-Bold.ttf) = 2853e5f41e6899baf226db2578aba09f2f88085eaea02da024621492d21e1af8bdefdefd354ea23dc4d5de5cb0d554085040a0108820f213e86dd532986fdb41 +SHA512 (Arimo-Italic.ttf) = 56ef918e5811dcd375e6cd8d79dc69f4db75d544639c0f6ac3a0343b3b4ef94b7dee5a6066f1558d8747a32bbee074256be68b943ff31cfbd2f5f32acfa7c1c5 +SHA512 (Arimo-Regular.ttf) = 05e6aa6b785b0038a8e0e0a8a618a1b8e907a700be302148eaebc91cfac3c9e2d9acf90b9d077ff3b9ff54bd5f8a9c522a039cff6103cdeee54be29b6a0b355f +SHA512 (Cousine-BoldItalic.ttf) = 2125aa9f5db4ae4a3725d308b6afbfbce5957f3c96a3c5fcba8ebf5cd167017d9c7023391e947ed68d12fa97e2cba3f156a3acca276d9f5ed50df7d78c07f918 +SHA512 (Cousine-Bold.ttf) = 1759fd23419ae0e1bfc9be92abb9cb0c74084ce85e7f53c055d86ec3d62da83169d0d67ed96fd4e496b28acf382933d63448459108b109d8202db7f18f05caab +SHA512 (Cousine-Italic.ttf) = ec3fc9d940b748dbbc64aa66184413a78ae2b085181eed563449df044b891e951e8feebd865be5be42f0cd001acf5bdce9084a006f9b5be32f096f7df0dc7700 +SHA512 (Cousine-Regular.ttf) = a665a6a4a5583079eb87509e2da7d6bd06965e6a7655217302b088caef942ae9ad63e6cffda18d0001fc9ab2284836766843e46bfdacd188b54f39d7855f36a0 +SHA512 (Tinos-BoldItalic.ttf) = 2574de2add94ef976b731fac688951fab49574c9b0ccd259ba647ea3598ca026bcfb88e2ea3f19effb3af71fdc0eb5fa9973f0b6e996c22185c5f2aab5a23fdd +SHA512 (Tinos-Bold.ttf) = 54aeca804c06a4d5c57ade596e73df91a6a1c4401c4aadba55d987b3fb73045d35f3df02678b59abb77c4914ec741755536c0adf808c931e4b77848c52c229c4 +SHA512 (Tinos-Italic.ttf) = d4f4f096110ef98a781a2a0e0d319317e5f84e650fe6f4d4f6b0e22a16414278217f37497b904a18540273c0e2d79d4f1faabde3b0eb5446283b318c73bafb38 +SHA512 (Tinos-Regular.ttf) = 58085c5dac6d067d60ba2ab3220c4a0cc1efcf279cadfcfb8746a5e5fa1a6f6daa62750dc2051b3b2d8a51b4d2e9bb0f66594caf2253c0870ed9c7286fa45e8f +SHA512 (Ahem.ttf) = aeb64b10ab9c87860714cb60b4900254b13dc52c51319256a1a3722c882026ab7c616bf628fbc2fe14e38a6003f3a481af60b52a7ed62071d28ddaf428e4e3fd +SHA512 (xcb-proto-1.14.tar.xz) = de66d568163b6da2be9d6c59984f3afa3acd119a781378638045fd68018665ef5c9af98f024e9962ba3eb7c7a4d85c27ba70ffafceb2324ccc6940f34de16690 +SHA512 (depot_tools.git-master.tar.gz) = dc323888812b66cc92c53a24a8a58ccf9e2961be67aa21852bd091b8b49569071f06ae9104cb58950e6253ac3a29f0db0663e9f35ef2b1ea28696efb38b42708 +SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1dc09f5a0fd7898e9d0a372ee4422b6b1cdab3c86ecc91db437e9ae8a951e64e85edc3ac9e9fca428852dbb2ad +SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a +SHA512 (node-v12.22.6-linux-arm64.tar.xz) = 87ce5eb954deb1d0debe6fa02b28a3cc675e12fca1e51d44b123ab294aa39ce0c6b8ac9eae1e7a6e32673ea2c2d480651d9ba7eea73012f0529503eebe9eb34d +SHA512 (node-v12.22.6-linux-x64.tar.xz) = e1b55c32343cb2ccc40d888c705414bebf9c46b02083d13731df79b1e79521b7277761f6bcca041e40e3a2e47c67bb8e7848aa2b919a9de5c2ebf62c4a9c7176 +SHA512 (chromium-100.0.4896.75-clean.tar.xz) = ca0a20d82a62c47215fe2eca969e62b09c5914b96c0c885247cea7f4fe128a7a74ef815499c8e8f354bad337131546bff2f89624ed7460fd3fb5c4092a50567d From a64efb067733a9bbf52145ef1184f2a73f89dbbb Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Thu, 7 Apr 2022 19:57:13 -0400 Subject: [PATCH 088/659] fix changelog --- chromium.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chromium.spec b/chromium.spec index cbee05c..395b360 100644 --- a/chromium.spec +++ b/chromium.spec @@ -2145,7 +2145,7 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog -* Tue Apr 25 2022 Tom Callaway - 100.0.4896.75-1 +* Tue Apr 5 2022 Tom Callaway - 100.0.4896.75-1 - update to 100.0.4896.75 * Sat Apr 2 2022 Tom Callaway - 100.0.4896.60-1 From 3b8ca2ebd5efb8255285bdda1b97f35f6c41c255 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Fri, 8 Apr 2022 10:16:22 -0400 Subject: [PATCH 089/659] fix std::tie issue, fix old xkb issue --- ...-100.0.4896.75-missing-include-tuple.patch | 11 +++++ chromium-100.0.4896.75-old-xkb.patch | 49 +++++++++++++++++++ chromium.spec | 11 +++++ 3 files changed, 71 insertions(+) create mode 100644 chromium-100.0.4896.75-missing-include-tuple.patch create mode 100644 chromium-100.0.4896.75-old-xkb.patch diff --git a/chromium-100.0.4896.75-missing-include-tuple.patch b/chromium-100.0.4896.75-missing-include-tuple.patch new file mode 100644 index 0000000..a354ad5 --- /dev/null +++ b/chromium-100.0.4896.75-missing-include-tuple.patch @@ -0,0 +1,11 @@ +diff -up chromium-100.0.4896.75/net/base/address_list.h.missing-include-tuple chromium-100.0.4896.75/net/base/address_list.h +--- chromium-100.0.4896.75/net/base/address_list.h.missing-include-tuple 2022-04-08 10:03:31.950894611 -0400 ++++ chromium-100.0.4896.75/net/base/address_list.h 2022-04-08 10:03:43.926970267 -0400 +@@ -8,6 +8,7 @@ + #include + + #include ++#include + #include + #include + diff --git a/chromium-100.0.4896.75-old-xkb.patch b/chromium-100.0.4896.75-old-xkb.patch new file mode 100644 index 0000000..e12b244 --- /dev/null +++ b/chromium-100.0.4896.75-old-xkb.patch @@ -0,0 +1,49 @@ +diff -up chromium-100.0.4896.75/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc.old-xkb chromium-100.0.4896.75/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc +--- chromium-100.0.4896.75/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc.old-xkb 2022-04-08 10:12:14.725197002 -0400 ++++ chromium-100.0.4896.75/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc 2022-04-08 10:13:04.512511489 -0400 +@@ -31,14 +31,6 @@ + #include "ui/events/keycodes/keyboard_code_conversion.h" + #include "ui/events/keycodes/keyboard_code_conversion_xkb.h" + +-// xkb_keymap_key_get_mods_for_level is relatively new (introduced in ver 1.0, +-// Sep 6, 2020), thus it is not available on some platform, such as Ubuntu +-// 18.04, which we still supports. +-// Thus declare the function as weak here, so we can check the availability on +-// runtime. +-extern "C" __attribute__((weak)) decltype( +- xkb_keymap_key_get_mods_for_level) xkb_keymap_key_get_mods_for_level; +- + namespace ui { + + namespace { +@@ -925,18 +917,10 @@ void XkbKeyboardLayoutEngine::SetKeymap( + const xkb_keysym_t* keysyms; + int num_syms = xkb_keymap_key_get_syms_by_level(keymap, keycode, layout, + level, &keysyms); +- if (xkb_keymap_key_get_mods_for_level) { +- xkb_mod_mask_t masks[100]; // Large enough buffer. +- int num_mods = xkb_keymap_key_get_mods_for_level( +- keymap, keycode, layout, level, masks, std::size(masks)); +- AddEntries(base::make_span(keysyms, num_syms), +- base::make_span(masks, num_mods), keycode); +- } else { + // If not, unfortunately, there's no convenient/efficient way + // to take the possible masks. Thus, use mask 0 always. + constexpr xkb_mod_mask_t kMask[] = {0}; + AddEntries(base::make_span(keysyms, num_syms), kMask, keycode); +- } + } + } + } +@@ -1000,10 +984,7 @@ int XkbKeyboardLayoutEngine::UpdateModif + + DomCode XkbKeyboardLayoutEngine::GetDomCodeByKeysym(uint32_t keysym, + uint32_t modifiers) const { +- // If xkb_keymap_key_get_mods_for_level is not available, all entries are +- // stored with modifiers mask is 0. +- if (!xkb_keymap_key_get_mods_for_level) +- modifiers = 0; ++ modifiers = 0; + + auto iter = xkb_keysym_map_.find(XkbKeysymMapKey(keysym, modifiers)); + if (iter == xkb_keysym_map_.end()) { diff --git a/chromium.spec b/chromium.spec index 395b360..0dc705d 100644 --- a/chromium.spec +++ b/chromium.spec @@ -292,6 +292,8 @@ Patch64: chromium-91.0.4472.77-aarch64-cxxflags-addition.patch # Fix issue where closure_compiler thinks java is only allowed in android builds # https://bugs.chromium.org/p/chromium/issues/detail?id=1192875 Patch65: chromium-91.0.4472.77-java-only-allowed-in-android-builds.patch +# Need for std::tie +Patch66: chromium-100.0.4896.75-missing-include-tuple.patch # Fix missing cstring in remoting code Patch67: chromium-98.0.4758.80-remoting-cstring.patch @@ -358,6 +360,10 @@ Patch109: chromium-98.0.4758.80-epel7-erase-fix.patch Patch110: chromium-90.0.4430.93-epel8-aarch64-libpng16-symbol-prefixes.patch # Add additional operator== to make el7 happy. Patch111: chromium-99.0.4844.51-el7-extra-operator==.patch +# EPEL7 and EPEL8 do not have a new enough libxkbcommon to support xkb_keymap_key_get_mods_for_level +# and the weak attribute hack that chromium tries doesn't seem to work on gcc +Patch112: chromium-100.0.4896.75-old-xkb.patch + # VAAPI # Upstream turned VAAPI on in Linux in 86 @@ -999,6 +1005,7 @@ udev. %patch63 -p1 -b .SCTHashdanceMetadata-move %patch64 -p1 -b .aarch64-cxxflags-addition %patch65 -p1 -b .java-only-allowed +%patch66 -p1 -b .missing-include-tuple %patch67 -p1 -b .remoting-cstring %patch68 -p1 -b .i686-textrels %patch79 -p1 -b .widevine-no-download @@ -1036,6 +1043,10 @@ udev. %patch110 -p1 -b .el8-aarch64-libpng16-symbol-prefixes %endif +%if 0%{?rhel} == 7 || 0%{?rhel} == 8 +%patch111 -p1 -b .old-xkb +%endif + # Feature specific patches %if %{use_vaapi} %patch202 -p1 -b .accel-mjpeg From 243123576e03341974d22a2e3a4ce2bed423a340 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Mon, 11 Apr 2022 18:15:28 -0400 Subject: [PATCH 090/659] fix missing , actually apply xkb patch --- chromium-100.0.4896.75-missing-include-vector.patch | 11 +++++++++++ chromium.spec | 6 +++++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 chromium-100.0.4896.75-missing-include-vector.patch diff --git a/chromium-100.0.4896.75-missing-include-vector.patch b/chromium-100.0.4896.75-missing-include-vector.patch new file mode 100644 index 0000000..4e524d8 --- /dev/null +++ b/chromium-100.0.4896.75-missing-include-vector.patch @@ -0,0 +1,11 @@ +diff -up chromium-100.0.4896.75/media/capabilities/webrtc_video_stats_db.h.missing-vector chromium-100.0.4896.75/media/capabilities/webrtc_video_stats_db.h +--- chromium-100.0.4896.75/media/capabilities/webrtc_video_stats_db.h.missing-vector 2022-04-11 18:10:09.979195562 -0400 ++++ chromium-100.0.4896.75/media/capabilities/webrtc_video_stats_db.h 2022-04-11 18:10:30.261338074 -0400 +@@ -7,6 +7,7 @@ + + #include + #include ++#include + + #include "base/callback_forward.h" + #include "base/check.h" diff --git a/chromium.spec b/chromium.spec index 0dc705d..eab8dab 100644 --- a/chromium.spec +++ b/chromium.spec @@ -299,6 +299,9 @@ Patch66: chromium-100.0.4896.75-missing-include-tuple.patch Patch67: chromium-98.0.4758.80-remoting-cstring.patch # Apply fix_textrels hack for i686 (even without lld) Patch68: chromium-84.0.4147.125-i686-fix_textrels.patch +# Need for std::vector +Patch69: chromium-100.0.4896.75-missing-include-vector.patch + # Do not download proprietary widevine module in the background (thanks Debian) Patch79: chromium-99.0.4844.51-widevine-no-download.patch @@ -1008,6 +1011,7 @@ udev. %patch66 -p1 -b .missing-include-tuple %patch67 -p1 -b .remoting-cstring %patch68 -p1 -b .i686-textrels +%patch69 -p1 -b .missing-include-vector %patch79 -p1 -b .widevine-no-download %patch80 -p1 -b .EnumTable-crash %patch81 -p1 -b .gcc12fix @@ -1044,7 +1048,7 @@ udev. %endif %if 0%{?rhel} == 7 || 0%{?rhel} == 8 -%patch111 -p1 -b .old-xkb +%patch112 -p1 -b .old-xkb %endif # Feature specific patches From 0d9d66e66b11c3483d0e5a4c3d8cc19b222253d9 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Fri, 22 Apr 2022 14:30:31 -0400 Subject: [PATCH 091/659] 100.0.4896.127 --- chromium.spec | 5 ++++- sources | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/chromium.spec b/chromium.spec index eab8dab..a1595a8 100644 --- a/chromium.spec +++ b/chromium.spec @@ -222,7 +222,7 @@ Name: chromium%{chromium_channel}%{nsuffix} %else Name: chromium%{chromium_channel} %endif -Version: %{majorversion}.0.4896.75 +Version: %{majorversion}.0.4896.127 Release: 1%{?dist} %if %{?freeworld} %if %{?shared} @@ -2160,6 +2160,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Thu Apr 21 2022 Tom Callaway - 100.0.4896.127-1 +- update to 100.0.4896.127 + * Tue Apr 5 2022 Tom Callaway - 100.0.4896.75-1 - update to 100.0.4896.75 diff --git a/sources b/sources index fe0b96d..8fe62c2 100644 --- a/sources +++ b/sources @@ -21,4 +21,4 @@ SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1d SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a SHA512 (node-v12.22.6-linux-arm64.tar.xz) = 87ce5eb954deb1d0debe6fa02b28a3cc675e12fca1e51d44b123ab294aa39ce0c6b8ac9eae1e7a6e32673ea2c2d480651d9ba7eea73012f0529503eebe9eb34d SHA512 (node-v12.22.6-linux-x64.tar.xz) = e1b55c32343cb2ccc40d888c705414bebf9c46b02083d13731df79b1e79521b7277761f6bcca041e40e3a2e47c67bb8e7848aa2b919a9de5c2ebf62c4a9c7176 -SHA512 (chromium-100.0.4896.75-clean.tar.xz) = ca0a20d82a62c47215fe2eca969e62b09c5914b96c0c885247cea7f4fe128a7a74ef815499c8e8f354bad337131546bff2f89624ed7460fd3fb5c4092a50567d +SHA512 (chromium-100.0.4896.127-clean.tar.xz) = 67b38e74d5aa35aef62ebfeb3856c268e6563b74cb6508993a14af3d8c2f2463208760c9cab265c09a8735a80a56d9d585640b14c4cd4f21110eb0e7b8e21250 From 22ce682b2ae88783c9a243d44beb08037c1d255a Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Sun, 12 Jun 2022 15:24:00 -0400 Subject: [PATCH 092/659] 102.0.5005.115 --- ...mium-101.0.4951.41-fedora-user-agent.patch | 12 ++ ...4951.41-remoting-extra-qualification.patch | 165 ++++++++++++++++++ chromium-102-fenced_frame_utils-include.patch | 25 +++ chromium-102-regex_pattern-array.patch | 14 ++ ...2-swiftshader-template-instantiation.patch | 47 +++++ chromium-102-symbolize-include.patch | 43 +++++ ...61-enable-hardware-accelerated-mjpeg.patch | 62 +++++++ chromium.spec | 71 ++++---- sources | 2 +- 9 files changed, 407 insertions(+), 34 deletions(-) create mode 100644 chromium-101.0.4951.41-fedora-user-agent.patch create mode 100644 chromium-101.0.4951.41-remoting-extra-qualification.patch create mode 100644 chromium-102-fenced_frame_utils-include.patch create mode 100644 chromium-102-regex_pattern-array.patch create mode 100644 chromium-102-swiftshader-template-instantiation.patch create mode 100644 chromium-102-symbolize-include.patch create mode 100644 chromium-102.0.5005.61-enable-hardware-accelerated-mjpeg.patch diff --git a/chromium-101.0.4951.41-fedora-user-agent.patch b/chromium-101.0.4951.41-fedora-user-agent.patch new file mode 100644 index 0000000..a328425 --- /dev/null +++ b/chromium-101.0.4951.41-fedora-user-agent.patch @@ -0,0 +1,12 @@ +diff -up chromium-101.0.4951.41/content/common/user_agent.cc.fedora-user-agent chromium-101.0.4951.41/content/common/user_agent.cc +--- chromium-101.0.4951.41/content/common/user_agent.cc.fedora-user-agent 2022-04-27 20:03:36.913767022 +0000 ++++ chromium-101.0.4951.41/content/common/user_agent.cc 2022-04-27 20:04:30.591942420 +0000 +@@ -34,7 +34,7 @@ std::string GetUserAgentPlatform() { + #elif BUILDFLAG(IS_MAC) + return "Macintosh; "; + #elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +- return "X11; "; // strange, but that's what Firefox uses ++ return "X11; Fedora; "; // strange, but that's what Firefox uses + #elif BUILDFLAG(IS_ANDROID) + return "Linux; "; + #elif BUILDFLAG(IS_FUCHSIA) diff --git a/chromium-101.0.4951.41-remoting-extra-qualification.patch b/chromium-101.0.4951.41-remoting-extra-qualification.patch new file mode 100644 index 0000000..c21ac38 --- /dev/null +++ b/chromium-101.0.4951.41-remoting-extra-qualification.patch @@ -0,0 +1,165 @@ +diff -up chromium-101.0.4951.41/remoting/host/mojom/remoting_mojom_traits.h.remoting-extra-qualification chromium-101.0.4951.41/remoting/host/mojom/remoting_mojom_traits.h +--- chromium-101.0.4951.41/remoting/host/mojom/remoting_mojom_traits.h.remoting-extra-qualification 2022-04-27 20:08:44.312318089 +0000 ++++ chromium-101.0.4951.41/remoting/host/mojom/remoting_mojom_traits.h 2022-04-28 16:11:30.308481321 +0000 +@@ -32,7 +32,7 @@ + namespace mojo { + + template <> +-class mojo::StructTraits { ++class StructTraits { + public: + static bool value(bool value) { return value; } + +@@ -43,7 +43,7 @@ class mojo::StructTraits +-class mojo::StructTraits { ++class StructTraits { + public: + static float value(float value) { return value; } + +@@ -54,7 +54,7 @@ class mojo::StructTraits +-class mojo::StructTraits { ++class StructTraits { + public: + static int32_t value(int32_t value) { return value; } + +@@ -66,7 +66,7 @@ class mojo::StructTraits +-class mojo::StructTraits { ++class StructTraits { + public: + static uint32_t value(uint32_t value) { return value; } + +@@ -78,7 +78,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static bool use_update_notifications( +@@ -103,7 +103,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static bool enable_curtaining( +@@ -200,7 +200,7 @@ struct EnumTraits +-class mojo::StructTraits { + public: + static int32_t left(const ::webrtc::DesktopRect& rect) { return rect.left(); } +@@ -220,7 +220,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static int32_t width(const ::webrtc::DesktopSize& size) { +@@ -236,7 +236,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static int32_t x(const ::webrtc::DesktopVector& vector) { return vector.x(); } +@@ -475,7 +475,7 @@ struct EnumTraits +-class mojo::StructTraits> { + public: + static int32_t timestamp( +@@ -513,7 +513,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static const std::string& mime_type( +@@ -531,7 +531,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static bool pressed(const ::remoting::protocol::KeyEvent& event) { +@@ -567,7 +567,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static absl::optional x( +@@ -656,7 +656,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static const ::webrtc::DesktopSize& dimensions( +@@ -674,7 +674,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static const std::string& text(const ::remoting::protocol::TextEvent& event) { +@@ -686,7 +686,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static uint32_t id(const ::remoting::protocol::TouchEventPoint& event) { +@@ -763,7 +763,7 @@ struct EnumTraits +-class mojo::StructTraits { + public: + static ::remoting::protocol::TouchEvent::TouchEventType event_type( +@@ -823,7 +823,7 @@ struct EnumTraits +-class mojo::StructTraits { + public: + static ::remoting::protocol::TransportRoute::RouteType type( diff --git a/chromium-102-fenced_frame_utils-include.patch b/chromium-102-fenced_frame_utils-include.patch new file mode 100644 index 0000000..61f904b --- /dev/null +++ b/chromium-102-fenced_frame_utils-include.patch @@ -0,0 +1,25 @@ +From 7c135a291184b59a59643ed6a8c40b4405ac0175 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Wed, 27 Apr 2022 16:01:01 +0000 +Subject: [PATCH] IWYU: add cstring for std::strlen in fenced_frame_utils + +--- + third_party/blink/common/fenced_frame/fenced_frame_utils.cc | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/third_party/blink/common/fenced_frame/fenced_frame_utils.cc b/third_party/blink/common/fenced_frame/fenced_frame_utils.cc +index 9e2d3ad..68f4823 100644 +--- a/third_party/blink/common/fenced_frame/fenced_frame_utils.cc ++++ b/third_party/blink/common/fenced_frame/fenced_frame_utils.cc +@@ -4,6 +4,8 @@ + + #include "third_party/blink/public/common/fenced_frame/fenced_frame_utils.h" + ++#include ++ + #include "base/guid.h" + #include "base/strings/string_util.h" + +-- +2.35.1 + diff --git a/chromium-102-regex_pattern-array.patch b/chromium-102-regex_pattern-array.patch new file mode 100644 index 0000000..18058b1 --- /dev/null +++ b/chromium-102-regex_pattern-array.patch @@ -0,0 +1,14 @@ +--- a/components/autofill/core/browser/BUILD.gn ++++ b/components/autofill/core/browser/BUILD.gn +@@ -54,6 +54,11 @@ action("regex_patterns_inl_h") { + } + + static_library("browser") { ++ if (is_clang) { ++ cflags = [ ++ "-fbracket-depth=1000", ++ ] ++ } + sources = [ + "address_normalization_manager.cc", + "address_normalization_manager.h", diff --git a/chromium-102-swiftshader-template-instantiation.patch b/chromium-102-swiftshader-template-instantiation.patch new file mode 100644 index 0000000..13584d5 --- /dev/null +++ b/chromium-102-swiftshader-template-instantiation.patch @@ -0,0 +1,47 @@ +From 89c498edff683c68df6be0dd224848f4b4af5ae7 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Mon, 25 Apr 2022 13:25:02 +0200 +Subject: [PATCH] GCC: add explicit template instantiation + +Bug: b/223668065 +Change-Id: I97ea197273f2b46b6a47a9fdfbbfb5065fbd8edd +Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/65268 +Kokoro-Result: kokoro +Reviewed-by: Nicolas Capens +Reviewed-by: Alexis Hétu +Commit-Queue: Alexis Hétu +Tested-by: Alexis Hétu +--- + +diff --git a/third_party/swiftshader/third_party/subzero/src/IceInstX8632.cpp b/third_party/swiftshader/third_party/subzero/src/IceInstX8632.cpp +index fe87eee..94cac3b 100644 +--- a/third_party/swiftshader/third_party/subzero/src/IceInstX8632.cpp ++++ b/third_party/swiftshader/third_party/subzero/src/IceInstX8632.cpp +@@ -710,6 +710,11 @@ + } + } + ++template void emitIASRegOpTyGPR(const Cfg *Func, Type Ty, ++ const Variable *Var, ++ const Operand *Src, ++ const GPREmitterRegOp &Emitter); ++ + void emitIASAddrOpTyGPR(const Cfg *Func, Type Ty, const AsmAddress &Addr, + const Operand *Src, const GPREmitterAddrOp &Emitter) { + Assembler *Asm = Func->getAssembler(); +diff --git a/third_party/swiftshader/third_party/subzero/src/IceInstX8664.cpp b/third_party/swiftshader/third_party/subzero/src/IceInstX8664.cpp +index 9d655a1..f7097d2 100644 +--- a/third_party/swiftshader/third_party/subzero/src/IceInstX8664.cpp ++++ b/third_party/swiftshader/third_party/subzero/src/IceInstX8664.cpp +@@ -698,6 +698,11 @@ + } + } + ++template void emitIASRegOpTyGPR(const Cfg *Func, Type Ty, ++ const Variable *Var, ++ const Operand *Src, ++ const GPREmitterRegOp &Emitter); ++ + void emitIASAddrOpTyGPR(const Cfg *Func, Type Ty, const AsmAddress &Addr, + const Operand *Src, const GPREmitterAddrOp &Emitter) { + Assembler *Asm = Func->getAssembler(); diff --git a/chromium-102-symbolize-include.patch b/chromium-102-symbolize-include.patch new file mode 100644 index 0000000..f4ac31d --- /dev/null +++ b/chromium-102-symbolize-include.patch @@ -0,0 +1,43 @@ +From 9dd0503835dc875807ab63efb1f477bffed2a852 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Mon, 25 Apr 2022 23:18:30 +0000 +Subject: [PATCH] IWYU: add utility for std::exchange + +Bug: 957519 +Change-Id: I307d520fdc34d2452018ed32a505e7e519739410 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3604643 +Reviewed-by: Wez +Commit-Queue: Stephan Hartmann +Cr-Commit-Position: refs/heads/main@{#995855} +--- + +diff --git a/base/third_party/symbolize/patches/0001-expose-object-file-helpers.patch b/base/third_party/symbolize/patches/0001-expose-object-file-helpers.patch +index b7376d8..72900a19 100644 +--- a/base/third_party/symbolize/patches/0001-expose-object-file-helpers.patch ++++ b/base/third_party/symbolize/patches/0001-expose-object-file-helpers.patch +@@ -118,11 +118,12 @@ + index c6f9ec4360ede..00cfa022219e6 100644 + --- a/base/third_party/symbolize/symbolize.h + +++ b/base/third_party/symbolize/symbolize.h +-@@ -60,6 +60,8 @@ ++@@ -60,6 +60,9 @@ + + #ifdef HAVE_SYMBOLIZE + + +#include +++#include + + + #if defined(__ELF__) // defined by gcc + #if defined(__OpenBSD__) +diff --git a/base/third_party/symbolize/symbolize.h b/base/third_party/symbolize/symbolize.h +index 99029a9..278078f 100644 +--- a/base/third_party/symbolize/symbolize.h ++++ b/base/third_party/symbolize/symbolize.h +@@ -61,6 +61,7 @@ + #ifdef HAVE_SYMBOLIZE + + #include ++#include + + #if defined(__ELF__) // defined by gcc + #if defined(__OpenBSD__) diff --git a/chromium-102.0.5005.61-enable-hardware-accelerated-mjpeg.patch b/chromium-102.0.5005.61-enable-hardware-accelerated-mjpeg.patch new file mode 100644 index 0000000..6873272 --- /dev/null +++ b/chromium-102.0.5005.61-enable-hardware-accelerated-mjpeg.patch @@ -0,0 +1,62 @@ +diff -up chromium-102.0.5005.61/chrome/browser/about_flags.cc.accel-mjpeg chromium-102.0.5005.61/chrome/browser/about_flags.cc +--- chromium-102.0.5005.61/chrome/browser/about_flags.cc.accel-mjpeg 2022-05-19 02:16:44.000000000 +0000 ++++ chromium-102.0.5005.61/chrome/browser/about_flags.cc 2022-06-03 20:09:42.298053196 +0000 +@@ -4308,12 +4308,12 @@ const FeatureEntry kFeatureEntries[] = { + flag_descriptions::kWebXrForceRuntimeDescription, kOsDesktop, + MULTI_VALUE_TYPE(kWebXrForceRuntimeChoices)}, + #endif // ENABLE_VR +-#if BUILDFLAG(IS_CHROMEOS_ASH) ++#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_LINUX) + {"disable-accelerated-mjpeg-decode", + flag_descriptions::kAcceleratedMjpegDecodeName, +- flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsCrOS, ++ flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsCrOS | kOsLinux, + SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedMjpegDecode)}, +-#endif // BUILDFLAG(IS_CHROMEOS_ASH) ++#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_LINUX) + {"system-keyboard-lock", flag_descriptions::kSystemKeyboardLockName, + flag_descriptions::kSystemKeyboardLockDescription, kOsDesktop, + FEATURE_VALUE_TYPE(features::kSystemKeyboardLock)}, +diff -up chromium-102.0.5005.61/chrome/browser/flag_descriptions.cc.accel-mjpeg chromium-102.0.5005.61/chrome/browser/flag_descriptions.cc +--- chromium-102.0.5005.61/chrome/browser/flag_descriptions.cc.accel-mjpeg 2022-06-03 17:55:53.493268667 +0000 ++++ chromium-102.0.5005.61/chrome/browser/flag_descriptions.cc 2022-06-03 20:22:41.162906775 +0000 +@@ -4029,7 +4029,7 @@ const char kUseAngleGL[] = "OpenGL"; + + // ChromeOS ------------------------------------------------------------------- + +-#if BUILDFLAG(IS_CHROMEOS_ASH) ++#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_LINUX) + + const char kAcceleratedMjpegDecodeName[] = + "Hardware-accelerated mjpeg decode for captured frame"; +@@ -4037,6 +4037,10 @@ const char kAcceleratedMjpegDecodeDescri + "Enable hardware-accelerated mjpeg decode for captured frame where " + "available."; + ++#endif ++ ++#if BUILDFLAG(IS_CHROMEOS_ASH) ++ + const char kAllowDisableTouchpadHapticFeedbackName[] = + "Allow disabling touchpad haptic feedback"; + const char kAllowDisableTouchpadHapticFeedbackDescription[] = +diff -up chromium-102.0.5005.61/chrome/browser/flag_descriptions.h.accel-mjpeg chromium-102.0.5005.61/chrome/browser/flag_descriptions.h +--- chromium-102.0.5005.61/chrome/browser/flag_descriptions.h.accel-mjpeg 2022-06-03 17:55:53.494268633 +0000 ++++ chromium-102.0.5005.61/chrome/browser/flag_descriptions.h 2022-06-03 20:23:50.514578649 +0000 +@@ -2303,11 +2303,15 @@ extern const char kUseAngleGL[]; + + // ChromeOS ------------------------------------------------------------------- + +-#if BUILDFLAG(IS_CHROMEOS_ASH) ++#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_LINUX) + + extern const char kAcceleratedMjpegDecodeName[]; + extern const char kAcceleratedMjpegDecodeDescription[]; + ++#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_LINUX) ++ ++#if BUILDFLAG(IS_CHROMEOS_ASH) ++ + extern const char kAllowDisableTouchpadHapticFeedbackName[]; + extern const char kAllowDisableTouchpadHapticFeedbackDescription[]; + diff --git a/chromium.spec b/chromium.spec index a1595a8..e4fd6ff 100644 --- a/chromium.spec +++ b/chromium.spec @@ -7,7 +7,7 @@ # This flag is so I can build things very fast on a giant system. # Enabling this in koji causes aarch64 builds to timeout indefinitely. -%global use_all_cpus 0 +%global use_all_cpus 1 %if %{use_all_cpus} %global numjobs %{_smp_build_ncpus} @@ -215,14 +215,14 @@ BuildRequires: libicu-devel >= 5.4 %global chromoting_client_id %nil %endif -%global majorversion 100 +%global majorversion 102 %if %{freeworld} Name: chromium%{chromium_channel}%{nsuffix} %else Name: chromium%{chromium_channel} %endif -Version: %{majorversion}.0.4896.127 +Version: %{majorversion}.0.5005.115 Release: 1%{?dist} %if %{?freeworld} %if %{?shared} @@ -264,7 +264,7 @@ Patch11: chromium-93.0.4577.63-py3-bootstrap.patch Patch11: chromium-92.0.4515.107-py2-bootstrap.patch %endif # Add "Fedora" to the user agent string -Patch12: chromium-99.0.4844.51-fedora-user-agent.patch +Patch12: chromium-101.0.4951.41-fedora-user-agent.patch # Needs to be submitted.. Patch51: chromium-96.0.4664.45-gcc-remoting-constexpr.patch @@ -279,28 +279,25 @@ Patch57: chromium-96.0.4664.45-missing-cstring.patch # prepare for using system ffmpeg (clean) # http://svnweb.mageia.org/packages/cauldron/chromium-browser-stable/current/SOURCES/chromium-53-ffmpeg-no-deprecation-errors.patch?view=markup Patch58: chromium-53-ffmpeg-no-deprecation-errors.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-100-GLImplementationParts-constexpr.patch -Patch60: chromium-100-GLImplementationParts-constexpr.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-100-InMilliseconds-constexpr.patch -Patch61: chromium-100-InMilliseconds-constexpr.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-100-macro-typo.patch -Patch62: chromium-100-macro-typo.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-100-SCTHashdanceMetadata-move.patch -Patch63: chromium-100-SCTHashdanceMetadata-move.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-102-fenced_frame_utils-include.patch +Patch59: chromium-102-fenced_frame_utils-include.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-102-regex_pattern-array.patch +Patch60: chromium-102-regex_pattern-array.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-102-swiftshader-template-instantiation.patch +Patch61: chromium-102-swiftshader-template-instantiation.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-102-symbolize-include.patch +Patch62: chromium-102-symbolize-include.patch + # Extra CXXFLAGS for aarch64 Patch64: chromium-91.0.4472.77-aarch64-cxxflags-addition.patch # Fix issue where closure_compiler thinks java is only allowed in android builds # https://bugs.chromium.org/p/chromium/issues/detail?id=1192875 Patch65: chromium-91.0.4472.77-java-only-allowed-in-android-builds.patch -# Need for std::tie -Patch66: chromium-100.0.4896.75-missing-include-tuple.patch # Fix missing cstring in remoting code Patch67: chromium-98.0.4758.80-remoting-cstring.patch # Apply fix_textrels hack for i686 (even without lld) Patch68: chromium-84.0.4147.125-i686-fix_textrels.patch -# Need for std::vector -Patch69: chromium-100.0.4896.75-missing-include-vector.patch # Do not download proprietary widevine module in the background (thanks Debian) @@ -327,7 +324,7 @@ Patch86: chromium-94.0.4606.81-clang-format.patch Patch87: chromium-99.0.4844.84-markdownsafe-soft_str.patch # Fix extra qualification error -Patch97: chromium-100.0.4896.75-remoting-extra-qualification.patch +Patch97: chromium-101.0.4951.41-remoting-extra-qualification.patch # From gentoo Patch98: chromium-94.0.4606.71-InkDropHost-crash.patch # Enable WebRTCPPipeWireCapturer by default @@ -370,7 +367,7 @@ Patch112: chromium-100.0.4896.75-old-xkb.patch # VAAPI # Upstream turned VAAPI on in Linux in 86 -Patch202: chromium-98.0.4758.80-enable-hardware-accelerated-mjpeg.patch +Patch202: chromium-102.0.5005.61-enable-hardware-accelerated-mjpeg.patch Patch203: chromium-86.0.4240.75-vaapi-i686-fpermissive.patch Patch205: chromium-86.0.4240.75-fix-vaapi-on-intel.patch @@ -455,6 +452,7 @@ BuildRequires: libusb-compat-0.1-devel %else BuildRequires: libusb-devel %endif +BuildRequires: libutempter-devel BuildRequires: libXdamage-devel BuildRequires: libXtst-devel BuildRequires: xcb-proto @@ -1002,19 +1000,17 @@ udev. %patch56 -p1 -b .missing-cstdint %patch57 -p1 -b .missing-cstring %patch58 -p1 -b .ffmpeg-deprecations -%patch60 -p1 -b .GLImplementationParts-constexpr -%patch61 -p1 -b .InMilliseconds-constexpr -%patch62 -p1 -b .macro-typo -%patch63 -p1 -b .SCTHashdanceMetadata-move +%patch59 -p1 -b .fenced_frame_utils-include +%patch60 -p1 -b .regex_pattern-array +%patch61 -p1 -b .swiftshader-template-instantiation +%patch62 -p1 -b .symbolize-include %patch64 -p1 -b .aarch64-cxxflags-addition %patch65 -p1 -b .java-only-allowed -%patch66 -p1 -b .missing-include-tuple %patch67 -p1 -b .remoting-cstring %patch68 -p1 -b .i686-textrels -%patch69 -p1 -b .missing-include-vector %patch79 -p1 -b .widevine-no-download %patch80 -p1 -b .EnumTable-crash -%patch81 -p1 -b .gcc12fix +# %%patch81 -p1 -b .gcc12fix %patch82 -p1 -b .remoting-no-tests %patch84 -p1 -b .remoting-missing-cmath-header %patch86 -p1 -b .clang-format-py3 @@ -1319,8 +1315,8 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/cros_system_api' \ 'third_party/dav1d' \ 'third_party/dawn' \ + 'third_party/dawn/third_party/gn' \ 'third_party/dawn/third_party/khronos' \ - 'third_party/dawn/third_party/tint' \ 'third_party/depot_tools' \ 'third_party/devscripts' \ 'third_party/devtools-frontend' \ @@ -1373,7 +1369,6 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/jstemplate' \ 'third_party/khronos' \ 'third_party/leveldatabase' \ - 'third_party/libXNVCtrl' \ 'third_party/libaddressinput' \ 'third_party/libaom' \ 'third_party/libaom/source/libaom/third_party/fastfeat' \ @@ -1424,7 +1419,6 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/node' \ 'third_party/node/node_modules/polymer-bundler/lib/third_party/UglifyJS2' \ 'third_party/one_euro_filter' \ - 'third_party/opencv' \ %if %{freeworld} 'third_party/openh264' \ %endif @@ -1482,6 +1476,7 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/swiftshader/third_party/marl' \ 'third_party/swiftshader/third_party/subzero' \ 'third_party/swiftshader/third_party/SPIRV-Headers' \ + 'third_party/swiftshader/third_party/SPIRV-Tools' \ 'third_party/tensorflow-text' \ 'third_party/test_fonts' \ 'third_party/tflite' \ @@ -1489,7 +1484,6 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/tflite/src/third_party/fft2d' \ 'third_party/ukey2' \ 'third_party/usb_ids' \ - 'third_party/usrsctp' \ 'third_party/utf' \ 'third_party/vulkan' \ 'third_party/wayland' \ @@ -1741,9 +1735,9 @@ rm -rf %{buildroot} pushd %{builddir} cp -a *.pak locales resources icudtl.dat %{buildroot}%{chromium_path} %ifarch x86_64 i686 aarch64 - cp -a swiftshader %{buildroot}%{chromium_path} - strip %{buildroot}%{chromium_path}/swiftshader/libEGL.so - strip %{buildroot}%{chromium_path}/swiftshader/libGLESv2.so + # cp -a swiftshader %{buildroot}%{chromium_path} + # strip %{buildroot}%{chromium_path}/swiftshader/libEGL.so + # strip %{buildroot}%{chromium_path}/swiftshader/libGLESv2.so cp -a libvk_swiftshader.so* %{buildroot}%{chromium_path} strip %{buildroot}%{chromium_path}/libvk_swiftshader.so cp -a libvulkan.so* %{buildroot}%{chromium_path} @@ -2035,12 +2029,13 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %endif %{chromium_path}/resources/ %ifarch x86_64 i686 aarch64 -%{chromium_path}/swiftshader/ +# %%{chromium_path}/swiftshader/ %{chromium_path}/libvk_swiftshader.so* %{chromium_path}/libvulkan.so* %{chromium_path}/vk_swiftshader_icd.json %endif %dir %{chromium_path}/locales/ +%lang(af) %{chromium_path}/locales/af.pak* %lang(am) %{chromium_path}/locales/am.pak* %lang(ar) %{chromium_path}/locales/ar.pak* %lang(bg) %{chromium_path}/locales/bg.pak* @@ -2094,6 +2089,7 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %lang(th) %{chromium_path}/locales/th.pak* %lang(tr) %{chromium_path}/locales/tr.pak* %lang(uk) %{chromium_path}/locales/uk.pak* +%lang(ur) %{chromium_path}/locales/ur.pak* %lang(vi) %{chromium_path}/locales/vi.pak* %lang(zh_CN) %{chromium_path}/locales/zh-CN.pak* %lang(zh_TW) %{chromium_path}/locales/zh-TW.pak* @@ -2160,6 +2156,15 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Fri Jun 10 2022 Tom Callaway - 102.0.5005.115-1 +- update to 102.0.5005.115 + +* Fri Jun 3 2022 Tom Callaway - 102.0.5005.61-1 +- update to 102.0.5005.61 + +* Wed Apr 27 2022 Tom Callaway - 101.0.4951.41-1 +- update to 101.0.4951.41 + * Thu Apr 21 2022 Tom Callaway - 100.0.4896.127-1 - update to 100.0.4896.127 diff --git a/sources b/sources index 8fe62c2..8f49caa 100644 --- a/sources +++ b/sources @@ -21,4 +21,4 @@ SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1d SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a SHA512 (node-v12.22.6-linux-arm64.tar.xz) = 87ce5eb954deb1d0debe6fa02b28a3cc675e12fca1e51d44b123ab294aa39ce0c6b8ac9eae1e7a6e32673ea2c2d480651d9ba7eea73012f0529503eebe9eb34d SHA512 (node-v12.22.6-linux-x64.tar.xz) = e1b55c32343cb2ccc40d888c705414bebf9c46b02083d13731df79b1e79521b7277761f6bcca041e40e3a2e47c67bb8e7848aa2b919a9de5c2ebf62c4a9c7176 -SHA512 (chromium-100.0.4896.127-clean.tar.xz) = 67b38e74d5aa35aef62ebfeb3856c268e6563b74cb6508993a14af3d8c2f2463208760c9cab265c09a8735a80a56d9d585640b14c4cd4f21110eb0e7b8e21250 +SHA512 (chromium-102.0.5005.115-clean.tar.xz) = 43482534f96ced335073a1136f4b292bee8a9a0c31cd4b12675739b15ddb5d5351fea17b9445b36e80bccb37e086578274a5bd643a906e70d05230be136d7fc8 From 1e38bc640f8718b59b9b4b4374fbe4f06fa16be7 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Sun, 12 Jun 2022 15:27:58 -0400 Subject: [PATCH 093/659] use_all_cpus 0 --- chromium.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chromium.spec b/chromium.spec index e4fd6ff..1dd6b79 100644 --- a/chromium.spec +++ b/chromium.spec @@ -7,7 +7,7 @@ # This flag is so I can build things very fast on a giant system. # Enabling this in koji causes aarch64 builds to timeout indefinitely. -%global use_all_cpus 1 +%global use_all_cpus 0 %if %{use_all_cpus} %global numjobs %{_smp_build_ncpus} From 6e42b8cf18e052d0eded6821a04806ca08f7e08f Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Sun, 12 Jun 2022 15:47:35 -0400 Subject: [PATCH 094/659] rhel cleanups --- chromium.spec | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/chromium.spec b/chromium.spec index 1dd6b79..75bed7e 100644 --- a/chromium.spec +++ b/chromium.spec @@ -360,9 +360,6 @@ Patch109: chromium-98.0.4758.80-epel7-erase-fix.patch Patch110: chromium-90.0.4430.93-epel8-aarch64-libpng16-symbol-prefixes.patch # Add additional operator== to make el7 happy. Patch111: chromium-99.0.4844.51-el7-extra-operator==.patch -# EPEL7 and EPEL8 do not have a new enough libxkbcommon to support xkb_keymap_key_get_mods_for_level -# and the weak attribute hack that chromium tries doesn't seem to work on gcc -Patch112: chromium-100.0.4896.75-old-xkb.patch # VAAPI @@ -1043,10 +1040,6 @@ udev. %patch110 -p1 -b .el8-aarch64-libpng16-symbol-prefixes %endif -%if 0%{?rhel} == 7 || 0%{?rhel} == 8 -%patch112 -p1 -b .old-xkb -%endif - # Feature specific patches %if %{use_vaapi} %patch202 -p1 -b .accel-mjpeg @@ -1129,12 +1122,12 @@ unzip %{SOURCE113} cp -a /usr/share/fonts/lohit-gurmukhi/Lohit-Gurmukhi.ttf . cp -a /usr/share/fonts/google-noto-cjk/NotoSansCJKjp-Regular.otf . %endif -%if 0%{?fedora} >= 32 +%if 0%{?fedora} >= 32 || 0%{?rhel} >= 9 cp -a /usr/share/fonts/dejavu-sans-fonts/DejaVuSans.ttf /usr/share/fonts/dejavu-sans-fonts/DejaVuSans-Bold.ttf . %else cp -a /usr/share/fonts/dejavu/DejaVuSans.ttf /usr/share/fonts/dejavu/DejaVuSans-Bold.ttf . %endif -%if 0%{?fedora} >= 33 +%if 0%{?fedora} >= 33 || 0%{?rhel} >= 9 cp -a /usr/share/fonts/thai-scalable/Garuda.otf . sed -i 's|Garuda.ttf|Garuda.otf|g' ../BUILD.gn %else From ac544348b88d970b00b2b4729414e7a02604874b Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Mon, 13 Jun 2022 09:35:28 -0400 Subject: [PATCH 095/659] fix gnome-keyring conditional for epel9 --- chromium.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chromium.spec b/chromium.spec index 75bed7e..154e813 100644 --- a/chromium.spec +++ b/chromium.spec @@ -616,7 +616,8 @@ BuildRequires: re2-devel >= 20160401 BuildRequires: speech-dispatcher-devel BuildRequires: yasm BuildRequires: zlib-devel -%if 0%{?rhel} < 8 +# Technically, this logic probably applies to older rhel too... but whatever. +%if 0%{?fedora} || 0%{?rhel} == 7 || 0%{?rhel} >= 9 BuildRequires: pkgconfig(gnome-keyring-1) %endif # remote desktop needs this From 340fe716d21ac4d14d4bb2544caeb7494505f7f6 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Mon, 13 Jun 2022 09:39:48 -0400 Subject: [PATCH 096/659] add BR on git binary --- chromium.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chromium.spec b/chromium.spec index 154e813..d84cc51 100644 --- a/chromium.spec +++ b/chromium.spec @@ -500,6 +500,8 @@ BuildRequires: flac-devel %else BuildRequires: freetype-devel %endif +# One of the python scripts invokes git to look for a hash. So helpful. +BuildRequires: /usr/bin/git BuildRequires: hwdata BuildRequires: kernel-headers BuildRequires: libevent-devel From 5d6968f9db9374f64034c82f23a235560ad43736 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Mon, 13 Jun 2022 10:10:16 -0400 Subject: [PATCH 097/659] disable gnome-keyring on epel9 --- chromium.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chromium.spec b/chromium.spec index d84cc51..3303698 100644 --- a/chromium.spec +++ b/chromium.spec @@ -619,7 +619,8 @@ BuildRequires: speech-dispatcher-devel BuildRequires: yasm BuildRequires: zlib-devel # Technically, this logic probably applies to older rhel too... but whatever. -%if 0%{?fedora} || 0%{?rhel} == 7 || 0%{?rhel} >= 9 +# RHEL 8 and 9 do not have gnome-keyring. Not sure why, but whatever again. +%if 0%{?fedora} || 0%{?rhel} == 7 BuildRequires: pkgconfig(gnome-keyring-1) %endif # remote desktop needs this @@ -1052,7 +1053,7 @@ udev. %patch205 -p1 -b .vaapi-intel-fix %endif -%if 0%{?rhel} == 8 +%if 0%{?rhel} >= 8 %patch300 -p1 -b .disblegnomekeyring %endif From cd477185d58f0d516eaa966e0b7bcc92252aae36 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Tue, 14 Jun 2022 16:40:12 -0400 Subject: [PATCH 098/659] aarch64 v8 gcc cfi fix --- ...02.0.5005.115-v8-aarch64-gcc-cfi-fix.patch | 26 +++++++++++++++++++ chromium.spec | 4 +++ 2 files changed, 30 insertions(+) create mode 100644 chromium-102.0.5005.115-v8-aarch64-gcc-cfi-fix.patch diff --git a/chromium-102.0.5005.115-v8-aarch64-gcc-cfi-fix.patch b/chromium-102.0.5005.115-v8-aarch64-gcc-cfi-fix.patch new file mode 100644 index 0000000..5c0200a --- /dev/null +++ b/chromium-102.0.5005.115-v8-aarch64-gcc-cfi-fix.patch @@ -0,0 +1,26 @@ +diff -up chromium-102.0.5005.115/v8/src/execution/arm64/pointer-authentication-arm64.h.gcc-cfi-fix chromium-102.0.5005.115/v8/src/execution/arm64/pointer-authentication-arm64.h +--- chromium-102.0.5005.115/v8/src/execution/arm64/pointer-authentication-arm64.h.gcc-cfi-fix 2022-06-14 16:34:21.710049421 -0400 ++++ chromium-102.0.5005.115/v8/src/execution/arm64/pointer-authentication-arm64.h 2022-06-14 16:35:17.650427761 -0400 +@@ -47,15 +47,17 @@ V8_INLINE Address PointerAuthentication: + #ifdef USE_SIMULATOR + return Simulator::StripPAC(pc, Simulator::kInstructionPointer); + #else ++ // x30 == lr, but use 'x30' instead of 'lr' below, as GCC does not accept ++ // 'lr' in the clobbers list. + asm volatile( +- " mov x16, lr\n" +- " mov lr, %[pc]\n" ++ " mov x16, x30\n" ++ " mov x30, %[pc]\n" + " xpaclri\n" +- " mov %[pc], lr\n" +- " mov lr, x16\n" ++ " mov %[pc], x30\n" ++ " mov x30, x16\n" + : [pc] "+r"(pc) + : +- : "x16", "lr"); ++ : "x16", "x30"); + return pc; + #endif + } diff --git a/chromium.spec b/chromium.spec index 3303698..7feebf1 100644 --- a/chromium.spec +++ b/chromium.spec @@ -288,6 +288,9 @@ Patch61: chromium-102-swiftshader-template-instantiation.patch # https://github.com/stha09/chromium-patches/blob/master/chromium-102-symbolize-include.patch Patch62: chromium-102-symbolize-include.patch +# https://github.com/v8/v8/commit/2ed27bba6a881a152887f3ab1008e989fce617e3 +Patch63: chromium-102.0.5005.115-v8-aarch64-gcc-cfi-fix.patch + # Extra CXXFLAGS for aarch64 Patch64: chromium-91.0.4472.77-aarch64-cxxflags-addition.patch # Fix issue where closure_compiler thinks java is only allowed in android builds @@ -1005,6 +1008,7 @@ udev. %patch60 -p1 -b .regex_pattern-array %patch61 -p1 -b .swiftshader-template-instantiation %patch62 -p1 -b .symbolize-include +%patch63 -p1 -b .gcc-cfi-fix %patch64 -p1 -b .aarch64-cxxflags-addition %patch65 -p1 -b .java-only-allowed %patch67 -p1 -b .remoting-cstring From effc42ab0a1c57618834bcb68f23b843c25a6bbf Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Wed, 15 Jun 2022 09:17:36 -0400 Subject: [PATCH 099/659] el9 aarch64 does not seem to have libva-devel --- chromium.spec | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/chromium.spec b/chromium.spec index 7feebf1..9f7289a 100644 --- a/chromium.spec +++ b/chromium.spec @@ -48,11 +48,18 @@ # We'd like to always have this on... # ... but the libva in EL7 (and EL8) is too old. +# ... and EL9 doesn't ship libva-devel on aarch64? %if 0%{?rhel} == 7 || 0%{?rhel} == 8 %global use_vaapi 0 %else +%if 0%{?rhel} == 9 +%ifarch aarch64 +%global use_vaapi 0 +%endif +%else %global use_vaapi 1 %endif +%endif # Seems like we might need this sometimes # Practically, no. But it's here in case we do. @@ -539,7 +546,9 @@ BuildRequires: libudev-devel Requires: libusbx >= 1.0.21-0.1.git448584a BuildRequires: libusbx-devel >= 1.0.21-0.1.git448584a %endif +%if 0%{?use_vaapi} BuildRequires: libva-devel +%endif # We don't use libvpx anymore because Chromium loves to # use bleeding edge revisions here that break other things # ... so we just use the bundled libvpx. From 3ee798bef1728e248ed42f2549f1e942422b1892 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Wed, 15 Jun 2022 09:23:11 -0400 Subject: [PATCH 100/659] fixup conditionals to be less obtuse --- chromium.spec | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/chromium.spec b/chromium.spec index 9f7289a..90881e8 100644 --- a/chromium.spec +++ b/chromium.spec @@ -47,18 +47,16 @@ %endif # We'd like to always have this on... +%global use_vaapi 1 # ... but the libva in EL7 (and EL8) is too old. -# ... and EL9 doesn't ship libva-devel on aarch64? %if 0%{?rhel} == 7 || 0%{?rhel} == 8 %global use_vaapi 0 -%else +%endif +# ... and EL9 doesn't ship libva-devel on aarch64? %if 0%{?rhel} == 9 -%ifarch aarch64 -%global use_vaapi 0 -%endif -%else -%global use_vaapi 1 -%endif + %ifarch aarch64 + %global use_vaapi 0 + %endif %endif # Seems like we might need this sometimes @@ -546,7 +544,7 @@ BuildRequires: libudev-devel Requires: libusbx >= 1.0.21-0.1.git448584a BuildRequires: libusbx-devel >= 1.0.21-0.1.git448584a %endif -%if 0%{?use_vaapi} +%if 0%{use_vaapi} BuildRequires: libva-devel %endif # We don't use libvpx anymore because Chromium loves to From 6b11f13d37c55513beb8970a7582815292bde526 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Wed, 15 Jun 2022 11:30:29 -0400 Subject: [PATCH 101/659] Need to explicitly include a kernel header on EL7 to support MFD_CLOEXEC --- chromium-102.0.5005.115-el7-memfd-include.patch | 11 +++++++++++ chromium.spec | 4 ++++ 2 files changed, 15 insertions(+) create mode 100644 chromium-102.0.5005.115-el7-memfd-include.patch diff --git a/chromium-102.0.5005.115-el7-memfd-include.patch b/chromium-102.0.5005.115-el7-memfd-include.patch new file mode 100644 index 0000000..8724909 --- /dev/null +++ b/chromium-102.0.5005.115-el7-memfd-include.patch @@ -0,0 +1,11 @@ +diff -up chromium-102.0.5005.115/v8/src/base/platform/platform-posix.cc.el7-memfd-include chromium-102.0.5005.115/v8/src/base/platform/platform-posix.cc +--- chromium-102.0.5005.115/v8/src/base/platform/platform-posix.cc.el7-memfd-include 2022-06-15 10:52:49.553817031 -0400 ++++ chromium-102.0.5005.115/v8/src/base/platform/platform-posix.cc 2022-06-15 10:56:15.775173013 -0400 +@@ -56,6 +56,7 @@ + + #if V8_OS_LINUX + #include // for prctl ++#include // for MFD_CLOEXEC + #endif + + #if defined(V8_OS_FUCHSIA) diff --git a/chromium.spec b/chromium.spec index 90881e8..c51d299 100644 --- a/chromium.spec +++ b/chromium.spec @@ -350,6 +350,9 @@ Patch103: chromium-99.0.4844.51-epel7-old-headers-workarounds.patch # Use old cups (chromium's code workaround breaks on gcc) # Revert: https://github.com/chromium/chromium/commit/c3213f8779ddc427e89d982514185ed5e4c94e91 Patch104: chromium-99.0.4844.51-epel7-old-cups.patch +# Need to explicitly include a kernel header on EL7 to support MFD_CLOEXEC +Patch105: chromium-102.0.5005.115-el7-memfd-include.patch + # Still not wrong, but it seems like only EL needs it Patch106: chromium-77-clang.patch # ARM failures on el8 related to int clashes @@ -1045,6 +1048,7 @@ udev. # %%patch102 -p1 -b .el7-noexcept %patch103 -p1 -b .epel7-header-workarounds %patch104 -p1 -b .el7cups +%patch105 -p1 -b .el7-memfd-include %patch108 -p1 -b .el7-old-libdrm %patch109 -p1 -b .el7-erase-fix %patch111 -p1 -b .el7-extra-operator-equalequal From d3e3951389177be3ed212d2cc19e69776b1bdc64 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Thu, 16 Jun 2022 13:18:05 -0400 Subject: [PATCH 102/659] fix minizip requires for el9 --- chromium.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/chromium.spec b/chromium.spec index c51d299..7d3caea 100644 --- a/chromium.spec +++ b/chromium.spec @@ -228,7 +228,7 @@ Name: chromium%{chromium_channel}%{nsuffix} Name: chromium%{chromium_channel} %endif Version: %{majorversion}.0.5005.115 -Release: 1%{?dist} +Release: 2%{?dist} %if %{?freeworld} %if %{?shared} # chromium-libs-media-freeworld @@ -898,9 +898,13 @@ Requires: minizip-compat%{_isa} %if %{?rhel} == 7 # Do nothing %else +%if %{?rhel} == 9 +Requires: minizip1.2%{_isa} +%else Requires: minizip%{_isa} %endif %endif +%endif # -common doesn't have chrome-remote-desktop bits # but we need to clean it up if it gets disabled again # NOTE: Check obsoletes version to be sure it matches @@ -2168,6 +2172,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Thu Jun 16 2022 Tom Callaway - 102.0.5005.115-2 +- fix minizip Requires for EL9 + * Fri Jun 10 2022 Tom Callaway - 102.0.5005.115-1 - update to 102.0.5005.115 From 05c57f9975df3c0d11b3fc0927f114061d7620ac Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Fri, 24 Jun 2022 17:04:40 -0500 Subject: [PATCH 103/659] clean script fixes --- clean_ffmpeg.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/clean_ffmpeg.sh b/clean_ffmpeg.sh index 2055fdc..614c0fe 100755 --- a/clean_ffmpeg.sh +++ b/clean_ffmpeg.sh @@ -77,6 +77,7 @@ header_files=" libavcodec/x86/inline_asm.h \ libavcodec/cbrt_tablegen.h \ libavcodec/codec.h \ libavcodec/codec_id.h \ + libavcodec/codec_internal.h \ libavcodec/codec_par.h \ libavcodec/dct.h \ libavcodec/dct32.h \ @@ -92,6 +93,7 @@ header_files=" libavcodec/x86/inline_asm.h \ libavcodec/get_bits.h \ libavcodec/h263dsp.h \ libavcodec/h264chroma.h \ + libavcodec/hevc.h \ libavcodec/hpeldsp.h \ libavcodec/hwaccels.h \ libavcodec/hwconfig.h \ @@ -140,9 +142,12 @@ header_files=" libavcodec/x86/inline_asm.h \ libavcodec/sbrdsp.h \ libavcodec/sinewin.h \ libavcodec/sinewin_tablegen.h \ + libavcodec/startcode.h \ libavcodec/thread.h \ + libavcodec/threadframe.h \ libavcodec/unary.h \ libavcodec/version.h \ + libavcodec/version_major.h \ libavcodec/videodsp.h \ libavcodec/vlc.h \ libavcodec/vorbisdsp.h \ @@ -167,6 +172,7 @@ header_files=" libavcodec/x86/inline_asm.h \ libavformat/srtp.h \ libavformat/options_table.h \ libavformat/version.h \ + libavformat/version_major.h \ libavformat/w64.h \ libavutil/aarch64/cpu.h \ libavutil/x86/asm.h \ @@ -209,6 +215,7 @@ header_files=" libavcodec/x86/inline_asm.h \ libavutil/version.h \ libswresample/swresample.h \ libswresample/version.h \ + libswresample/version_major.h \ compat/va_copy.h \ compat/atomics/gcc/stdatomic.h " From 8242b9a105a3ead2db978bbb8f384b3cab19b2bc Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Tue, 28 Jun 2022 19:00:59 -0400 Subject: [PATCH 104/659] 103.0.5060.53 --- chromium-103-FrameLoadRequest-type.patch | 26 ++ chromium-103-SubstringSetMatcher-packed.patch | 70 ++++++ chromium-103-VirtualCursor-std-layout.patch | 231 ++++++++++++++++++ ...5060.53-remoting-extra-qualification.patch | 219 +++++++++++++++++ chromium.spec | 44 ++-- sources | 2 +- 6 files changed, 571 insertions(+), 21 deletions(-) create mode 100644 chromium-103-FrameLoadRequest-type.patch create mode 100644 chromium-103-SubstringSetMatcher-packed.patch create mode 100644 chromium-103-VirtualCursor-std-layout.patch create mode 100644 chromium-103.0.5060.53-remoting-extra-qualification.patch diff --git a/chromium-103-FrameLoadRequest-type.patch b/chromium-103-FrameLoadRequest-type.patch new file mode 100644 index 0000000..cdace4b --- /dev/null +++ b/chromium-103-FrameLoadRequest-type.patch @@ -0,0 +1,26 @@ +From 491bf840da4f76fa3591cc0aa2f4c19cdbe57ec4 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Thu, 12 May 2022 11:58:29 +0000 +Subject: [PATCH] GCC: fix ambiguous references in blink::FrameLoadRequest + +Add namespace to avoid confusion. +--- + third_party/blink/renderer/core/loader/frame_load_request.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/third_party/blink/renderer/core/loader/frame_load_request.h b/third_party/blink/renderer/core/loader/frame_load_request.h +index 444b25c..a86814d 100644 +--- a/third_party/blink/renderer/core/loader/frame_load_request.h ++++ b/third_party/blink/renderer/core/loader/frame_load_request.h +@@ -179,7 +179,7 @@ struct CORE_EXPORT FrameLoadRequest { + impression_ = impression; + } + +- const absl::optional& Impression() const { return impression_; } ++ const absl::optional& Impression() const { return impression_; } + + bool CanDisplay(const KURL&) const; + +-- +2.35.1 + diff --git a/chromium-103-SubstringSetMatcher-packed.patch b/chromium-103-SubstringSetMatcher-packed.patch new file mode 100644 index 0000000..ae27bfc --- /dev/null +++ b/chromium-103-SubstringSetMatcher-packed.patch @@ -0,0 +1,70 @@ +From 3d274856e792a361336eb4ae1670bc9c1905f0cb Mon Sep 17 00:00:00 2001 +From: Steinar H. Gunderson +Date: Thu, 12 May 2022 16:42:40 +0200 +Subject: [PATCH] Make AhoCorasickNode 4-aligned. + +This should fix an issue where std::vector could allocate unaligned +memory for AhoCorasickNode, and we'd then return a pointer to +inline_edges, where a caller would expect the pointer to be aligned +but it wasn't. + +Change-Id: Id9dff044c61f8e46062c63b8480b18ebc68c4862 +--- + +diff --git a/base/substring_set_matcher/substring_set_matcher.cc b/base/substring_set_matcher/substring_set_matcher.cc +index e110047..ef0b750 100644 +--- a/base/substring_set_matcher/substring_set_matcher.cc ++++ b/base/substring_set_matcher/substring_set_matcher.cc +@@ -424,7 +424,12 @@ + edges_.inline_edges[num_edges()] = AhoCorasickEdge{label, node}; + if (label == kFailureNodeLabel) { + // Make sure that kFailureNodeLabel is first. +- std::swap(edges_.inline_edges[0], edges_.inline_edges[num_edges()]); ++ // NOTE: We don't use std::swap here, because GCC ++ // doesn't understand that inline_edges[] is 4-aligned ++ // and gives a warning. ++ AhoCorasickEdge temp = edges_.inline_edges[0]; ++ edges_.inline_edges[0] = edges_.inline_edges[num_edges()]; ++ edges_.inline_edges[num_edges()] = temp; + } + --num_free_edges_; + return; +diff --git a/base/substring_set_matcher/substring_set_matcher.cc b/base/substring_set_matcher/substring_set_matcher.cc +index e110047..ef0b750 100644 +--- a/base/substring_set_matcher/substring_set_matcher.h ++++ b/base/substring_set_matcher/substring_set_matcher.h +@@ -154,8 +154,9 @@ + static constexpr uint32_t kEmptyLabel = 0x103; + + // A node in the trie, packed tightly together so that it occupies 12 bytes +- // (both on 32- and 64-bit platforms). +- class AhoCorasickNode { ++ // (both on 32- and 64-bit platforms), but aligned to at least 4 (see the ++ // comment on edges_). ++ class alignas(AhoCorasickEdge) AhoCorasickNode { + public: + AhoCorasickNode(); + ~AhoCorasickNode(); +@@ -178,6 +179,10 @@ + NodeID GetEdgeNoInline(uint32_t label) const; + void SetEdge(uint32_t label, NodeID node); + const AhoCorasickEdge* edges() const { ++ // NOTE: Returning edges_.inline_edges here is fine, because it's ++ // the first thing in the struct (see the comment on edges_). ++ DCHECK_EQ(0u, reinterpret_cast(edges_.inline_edges) % ++ alignof(AhoCorasickEdge)); + return edges_capacity_ == 0 ? edges_.inline_edges : edges_.edges; + } + +@@ -258,6 +263,11 @@ + // in the first slot if it exists (ie., is not equal to kRootID), since we + // need to access that label during every single node we look at during + // traversal. ++ // ++ // NOTE: Keep this the first member in the struct, so that inline_edges gets ++ // 4-aligned (since the class is marked as such, despite being packed. ++ // Otherwise, edges() can return an unaligned pointer marked as aligned ++ // (the unalignedness gets lost). + static constexpr int kNumInlineEdges = 2; + union { + // Out-of-line edge storage, having room for edges_capacity_ elements. diff --git a/chromium-103-VirtualCursor-std-layout.patch b/chromium-103-VirtualCursor-std-layout.patch new file mode 100644 index 0000000..be0502e --- /dev/null +++ b/chromium-103-VirtualCursor-std-layout.patch @@ -0,0 +1,231 @@ +From 144479ad7b4287bee4067f95e4218f614798a865 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Sun, 16 Jan 2022 19:15:26 +0000 +Subject: [PATCH] sql: make VirtualCursor standard layout type + +sql::recover::VirtualCursor needs to be a standard layout type, but +has members of type std::unique_ptr. However, std::unique_ptr is not +guaranteed to be standard layout. Compiling with clang combined with +gcc-11 libstdc++ fails because of this. + +Bug: 1189788 +Change-Id: Ia6dc388cc5ef1c0f2afc75f8ca45b9f12687ca9c +--- + +diff --git a/sql/recover_module/btree.cc b/sql/recover_module/btree.cc +index cc9420e5..f12d8fa 100644 +--- a/sql/recover_module/btree.cc ++++ b/sql/recover_module/btree.cc +@@ -136,16 +136,22 @@ + "Move the destructor to the .cc file if it's non-trival"); + #endif // !DCHECK_IS_ON() + +-LeafPageDecoder::LeafPageDecoder(DatabasePageReader* db_reader) noexcept +- : page_id_(db_reader->page_id()), +- db_reader_(db_reader), +- cell_count_(ComputeCellCount(db_reader)), +- next_read_index_(0), +- last_record_size_(0) { ++LeafPageDecoder::LeafPageDecoder() noexcept = default; ++ ++void LeafPageDecoder::Initialize(DatabasePageReader* db_reader) { ++ page_id_ = db_reader->page_id(); ++ db_reader_ = db_reader; ++ cell_count_ = ComputeCellCount(db_reader); ++ next_read_index_ = 0; ++ last_record_size_ = 0; + DCHECK(IsOnValidPage(db_reader)); + DCHECK(DatabasePageReader::IsValidPageId(page_id_)); + } + ++void LeafPageDecoder::Reset() { ++ db_reader_ = nullptr; ++} ++ + bool LeafPageDecoder::TryAdvance() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(CanAdvance()); +diff --git a/sql/recover_module/btree.h b/sql/recover_module/btree.h +index eaa087a5..df0e0c9 100644 +--- a/sql/recover_module/btree.h ++++ b/sql/recover_module/btree.h +@@ -101,9 +101,7 @@ + public: + // Creates a decoder for a DatabasePageReader's last read page. + // +- // |db_reader| must have been used to read an inner page of a table B-tree. +- // |db_reader| must outlive this instance. +- explicit LeafPageDecoder(DatabasePageReader* db_reader) noexcept; ++ LeafPageDecoder() noexcept; + ~LeafPageDecoder() noexcept = default; + + LeafPageDecoder(const LeafPageDecoder&) = delete; +@@ -151,6 +149,17 @@ + // read as long as CanAdvance() returns true. + bool TryAdvance(); + ++ // Initialize with DatabasePageReader ++ // |db_reader| must have been used to read an inner page of a table B-tree. ++ // |db_reader| must outlive this instance. ++ void Initialize(DatabasePageReader* db_reader); ++ ++ // Reset internal DatabasePageReader ++ void Reset(); ++ ++ // True if DatabasePageReader is valid ++ bool IsValid() { return (db_reader_ != nullptr); } ++ + // True if the given reader may point to an inner page in a table B-tree. + // + // The last ReadPage() call on |db_reader| must have succeeded. +@@ -164,14 +173,14 @@ + static int ComputeCellCount(DatabasePageReader* db_reader); + + // The number of the B-tree page this reader is reading. +- const int64_t page_id_; ++ int64_t page_id_; + // Used to read the tree page. + // + // Raw pointer usage is acceptable because this instance's owner is expected + // to ensure that the DatabasePageReader outlives this. +- DatabasePageReader* const db_reader_; ++ DatabasePageReader* db_reader_; + // Caches the ComputeCellCount() value for this reader's page. +- const int cell_count_ = ComputeCellCount(db_reader_); ++ int cell_count_; + + // The reader's cursor state. + // +diff --git a/sql/recover_module/cursor.cc b/sql/recover_module/cursor.cc +index 4f827ed..240de499 100644 +--- a/sql/recover_module/cursor.cc ++++ b/sql/recover_module/cursor.cc +@@ -28,7 +28,7 @@ + int VirtualCursor::First() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + inner_decoders_.clear(); +- leaf_decoder_ = nullptr; ++ leaf_decoder_.Reset(); + + AppendPageDecoder(table_->root_page_id()); + return Next(); +@@ -38,18 +38,18 @@ + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + record_reader_.Reset(); + +- while (!inner_decoders_.empty() || leaf_decoder_.get()) { +- if (leaf_decoder_.get()) { +- if (!leaf_decoder_->CanAdvance()) { ++ while (!inner_decoders_.empty() || leaf_decoder_.IsValid()) { ++ if (leaf_decoder_.IsValid()) { ++ if (!leaf_decoder_.CanAdvance()) { + // The leaf has been exhausted. Remove it from the DFS stack. +- leaf_decoder_ = nullptr; ++ leaf_decoder_.Reset(); + continue; + } +- if (!leaf_decoder_->TryAdvance()) ++ if (!leaf_decoder_.TryAdvance()) + continue; + +- if (!payload_reader_.Initialize(leaf_decoder_->last_record_size(), +- leaf_decoder_->last_record_offset())) { ++ if (!payload_reader_.Initialize(leaf_decoder_.last_record_size(), ++ leaf_decoder_.last_record_offset())) { + continue; + } + if (!record_reader_.Initialize()) +@@ -101,13 +101,13 @@ + int64_t VirtualCursor::RowId() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(record_reader_.IsInitialized()); +- DCHECK(leaf_decoder_.get()); +- return leaf_decoder_->last_record_rowid(); ++ DCHECK(leaf_decoder_.IsValid()); ++ return leaf_decoder_.last_record_rowid(); + } + + void VirtualCursor::AppendPageDecoder(int page_id) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +- DCHECK(leaf_decoder_.get() == nullptr) ++ DCHECK(!leaf_decoder_.IsValid()) + << __func__ + << " must only be called when the current path has no leaf decoder"; + +@@ -115,7 +115,7 @@ + return; + + if (LeafPageDecoder::IsOnValidPage(&db_reader_)) { +- leaf_decoder_ = std::make_unique(&db_reader_); ++ leaf_decoder_.Initialize(&db_reader_); + return; + } + +diff --git a/sql/recover_module/cursor.h b/sql/recover_module/cursor.h +index 845b785..cc4e85f8 100644 +--- a/sql/recover_module/cursor.h ++++ b/sql/recover_module/cursor.h +@@ -130,7 +130,7 @@ + std::vector> inner_decoders_; + + // Decodes the leaf page containing records. +- std::unique_ptr leaf_decoder_; ++ LeafPageDecoder leaf_decoder_; + + SEQUENCE_CHECKER(sequence_checker_); + }; +diff --git a/sql/recover_module/pager.cc b/sql/recover_module/pager.cc +index 58e75de..69d98cef 100644 +--- a/sql/recover_module/pager.cc ++++ b/sql/recover_module/pager.cc +@@ -23,8 +23,7 @@ + "ints are not appropriate for representing page IDs"); + + DatabasePageReader::DatabasePageReader(VirtualTable* table) +- : page_data_(std::make_unique(table->page_size())), +- table_(table) { ++ : page_data_(table->page_size()), table_(table) { + DCHECK(table != nullptr); + DCHECK(IsValidPageSize(table->page_size())); + } +@@ -58,7 +57,7 @@ + "The |read_offset| computation above may overflow"); + + int sqlite_status = +- RawRead(sqlite_file, read_size, read_offset, page_data_.get()); ++ RawRead(sqlite_file, read_size, read_offset, page_data_.data()); + + // |page_id_| needs to be set to kInvalidPageId if the read failed. + // Otherwise, future ReadPage() calls with the previous |page_id_| value +diff --git a/sql/recover_module/pager.h b/sql/recover_module/pager.h +index 07cac3cb..d08f093 100644 +--- a/sql/recover_module/pager.h ++++ b/sql/recover_module/pager.h +@@ -6,8 +6,8 @@ + #define SQL_RECOVER_MODULE_PAGER_H_ + + #include +-#include + #include ++#include + + #include "base/check_op.h" + #include "base/memory/raw_ptr.h" +@@ -72,7 +72,7 @@ + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK_NE(page_id_, kInvalidPageId) + << "Successful ReadPage() required before accessing pager state"; +- return page_data_.get(); ++ return page_data_.data(); + } + + // The number of bytes in the page read by the last ReadPage() call. +@@ -139,7 +139,7 @@ + int page_id_ = kInvalidPageId; + // Stores the bytes of the last page successfully read by ReadPage(). + // The content is undefined if the last call to ReadPage() did not succeed. +- const std::unique_ptr page_data_; ++ std::vector page_data_; + // Raw pointer usage is acceptable because this instance's owner is expected + // to ensure that the VirtualTable outlives this. + const raw_ptr table_; diff --git a/chromium-103.0.5060.53-remoting-extra-qualification.patch b/chromium-103.0.5060.53-remoting-extra-qualification.patch new file mode 100644 index 0000000..37d2acf --- /dev/null +++ b/chromium-103.0.5060.53-remoting-extra-qualification.patch @@ -0,0 +1,219 @@ +diff -up chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h.remoting-extra-qualification chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h +--- chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h.remoting-extra-qualification 2022-06-27 22:16:20.214876025 +0000 ++++ chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h 2022-06-28 12:44:09.663890774 +0000 +@@ -37,7 +37,7 @@ + namespace mojo { + + template <> +-class mojo::StructTraits { ++class StructTraits { + public: + static bool value(bool value) { return value; } + +@@ -48,7 +48,7 @@ class mojo::StructTraits +-class mojo::StructTraits { ++class StructTraits { + public: + static float value(float value) { return value; } + +@@ -59,7 +59,7 @@ class mojo::StructTraits +-class mojo::StructTraits { ++class StructTraits { + public: + static int32_t value(int32_t value) { return value; } + +@@ -71,7 +71,7 @@ class mojo::StructTraits +-class mojo::StructTraits { ++class StructTraits { + public: + static uint32_t value(uint32_t value) { return value; } + +@@ -83,7 +83,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static bool use_update_notifications( +@@ -108,7 +108,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static bool enable_curtaining( +@@ -205,7 +205,7 @@ struct EnumTraits +-class mojo::StructTraits { + public: + static int32_t left(const ::webrtc::DesktopRect& rect) { return rect.left(); } +@@ -225,7 +225,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static int32_t width(const ::webrtc::DesktopSize& size) { +@@ -241,7 +241,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static int32_t x(const ::webrtc::DesktopVector& vector) { return vector.x(); } +@@ -253,7 +253,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static const webrtc::DesktopSize& image_size( +@@ -506,7 +506,7 @@ struct EnumTraits +-class mojo::StructTraits> { + public: + static int32_t timestamp( +@@ -544,7 +544,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static const std::string& mime_type( +@@ -562,7 +562,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static const ::google::protobuf:: +@@ -576,7 +576,7 @@ class mojo::StructTraits +-class mojo::UnionTraits { + public: + static remoting::mojom::KeyActionDataView::Tag GetTag( +@@ -609,7 +609,7 @@ class mojo::UnionTraits +-class mojo::StructTraits { + public: + static const ::google::protobuf::Map< +@@ -967,7 +967,7 @@ struct EnumTraits +-class mojo::StructTraits { + public: + static bool pressed(const ::remoting::protocol::KeyEvent& event) { +@@ -1003,7 +1003,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static absl::optional x( +@@ -1092,7 +1092,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static const ::webrtc::DesktopSize& dimensions( +@@ -1110,7 +1110,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static const std::string& text(const ::remoting::protocol::TextEvent& event) { +@@ -1122,7 +1122,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static uint32_t id(const ::remoting::protocol::TouchEventPoint& event) { +@@ -1199,7 +1199,7 @@ struct EnumTraits +-class mojo::StructTraits { + public: + static ::remoting::protocol::TouchEvent::TouchEventType event_type( +@@ -1259,7 +1259,7 @@ struct EnumTraits +-class mojo::StructTraits { + public: + static ::remoting::protocol::TransportRoute::RouteType type( +@@ -1406,7 +1406,7 @@ struct EnumTraits +-class mojo::StructTraits { + public: + static const ::google::protobuf::RepeatedPtrField< +@@ -1425,7 +1425,7 @@ class mojo::StructTraits +-class mojo::StructTraits { + public: + static int64_t screen_id( diff --git a/chromium.spec b/chromium.spec index 7d3caea..b434039 100644 --- a/chromium.spec +++ b/chromium.spec @@ -7,7 +7,7 @@ # This flag is so I can build things very fast on a giant system. # Enabling this in koji causes aarch64 builds to timeout indefinitely. -%global use_all_cpus 0 +%global use_all_cpus 1 %if %{use_all_cpus} %global numjobs %{_smp_build_ncpus} @@ -220,15 +220,15 @@ BuildRequires: libicu-devel >= 5.4 %global chromoting_client_id %nil %endif -%global majorversion 102 +%global majorversion 103 %if %{freeworld} Name: chromium%{chromium_channel}%{nsuffix} %else Name: chromium%{chromium_channel} %endif -Version: %{majorversion}.0.5005.115 -Release: 2%{?dist} +Version: %{majorversion}.0.5060.53 +Release: 1%{?dist} %if %{?freeworld} %if %{?shared} # chromium-libs-media-freeworld @@ -284,18 +284,15 @@ Patch57: chromium-96.0.4664.45-missing-cstring.patch # prepare for using system ffmpeg (clean) # http://svnweb.mageia.org/packages/cauldron/chromium-browser-stable/current/SOURCES/chromium-53-ffmpeg-no-deprecation-errors.patch?view=markup Patch58: chromium-53-ffmpeg-no-deprecation-errors.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-102-fenced_frame_utils-include.patch -Patch59: chromium-102-fenced_frame_utils-include.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-102-regex_pattern-array.patch -Patch60: chromium-102-regex_pattern-array.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-102-swiftshader-template-instantiation.patch -Patch61: chromium-102-swiftshader-template-instantiation.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-102-symbolize-include.patch -Patch62: chromium-102-symbolize-include.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-103-VirtualCursor-std-layout.patch +Patch59: chromium-103-VirtualCursor-std-layout.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-103-SubstringSetMatcher-packed.patch +Patch60: chromium-103-SubstringSetMatcher-packed.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-103-FrameLoadRequest-type.patch +Patch61: chromium-103-FrameLoadRequest-type.patch # https://github.com/v8/v8/commit/2ed27bba6a881a152887f3ab1008e989fce617e3 Patch63: chromium-102.0.5005.115-v8-aarch64-gcc-cfi-fix.patch - # Extra CXXFLAGS for aarch64 Patch64: chromium-91.0.4472.77-aarch64-cxxflags-addition.patch # Fix issue where closure_compiler thinks java is only allowed in android builds @@ -307,7 +304,6 @@ Patch67: chromium-98.0.4758.80-remoting-cstring.patch # Apply fix_textrels hack for i686 (even without lld) Patch68: chromium-84.0.4147.125-i686-fix_textrels.patch - # Do not download proprietary widevine module in the background (thanks Debian) Patch79: chromium-99.0.4844.51-widevine-no-download.patch @@ -332,7 +328,7 @@ Patch86: chromium-94.0.4606.81-clang-format.patch Patch87: chromium-99.0.4844.84-markdownsafe-soft_str.patch # Fix extra qualification error -Patch97: chromium-101.0.4951.41-remoting-extra-qualification.patch +Patch97: chromium-103.0.5060.53-remoting-extra-qualification.patch # From gentoo Patch98: chromium-94.0.4606.71-InkDropHost-crash.patch # Enable WebRTCPPipeWireCapturer by default @@ -1018,10 +1014,10 @@ udev. %patch56 -p1 -b .missing-cstdint %patch57 -p1 -b .missing-cstring %patch58 -p1 -b .ffmpeg-deprecations -%patch59 -p1 -b .fenced_frame_utils-include -%patch60 -p1 -b .regex_pattern-array -%patch61 -p1 -b .swiftshader-template-instantiation -%patch62 -p1 -b .symbolize-include +%patch59 -p1 -b .VirtualCursor-std-layout +%patch60 -p1 -b .SubstringSetMatcher-packed +%patch61 -p1 -b .FrameLoadRequest-type + %patch63 -p1 -b .gcc-cfi-fix %patch64 -p1 -b .aarch64-cxxflags-addition %patch65 -p1 -b .java-only-allowed @@ -1241,7 +1237,7 @@ CHROMIUM_HEADLESS_GN_DEFINES="" CHROMIUM_HEADLESS_GN_DEFINES+=' use_ozone=true ozone_auto_platforms=false ozone_platform="headless" ozone_platform_headless=true' CHROMIUM_HEADLESS_GN_DEFINES+=' headless_use_embedded_resources=false icu_use_data_file=false v8_use_external_startup_data=false' CHROMIUM_HEADLESS_GN_DEFINES+=' enable_nacl=false enable_print_preview=false enable_remoting=false use_alsa=false' -CHROMIUM_HEADLESS_GN_DEFINES+=' use_cups=false use_dbus=false use_gio=false use_kerberos=false use_libpci=false' +CHROMIUM_HEADLESS_GN_DEFINES+=' use_cups=false use_dbus=true use_gio=false use_kerberos=false use_libpci=false' CHROMIUM_HEADLESS_GN_DEFINES+=' use_pulseaudio=false use_udev=false use_gtk=false use_glib=false' export CHROMIUM_HEADLESS_GN_DEFINES @@ -1324,6 +1320,7 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/ced' \ 'third_party/cld_3' \ 'third_party/closure_compiler' \ + 'third_party/cpuinfo' \ 'third_party/crashpad' \ 'third_party/crashpad/crashpad/third_party/lss' \ 'third_party/crashpad/crashpad/third_party/zlib/' \ @@ -1365,8 +1362,10 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/flac' \ 'third_party/flatbuffers' \ 'third_party/fontconfig' \ + 'third_party/fp16' \ 'third_party/freetype' \ 'third_party/fusejs' \ + 'third_party/fxdiv' \ 'third_party/gemmlowp' \ 'third_party/google_input_tools' \ 'third_party/google_input_tools/third_party/closure_library' \ @@ -1458,6 +1457,7 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/pffft' \ 'third_party/ply' \ 'third_party/polymer' \ + 'third_party/pthreadpool' \ 'third_party/private-join-and-compute' \ 'third_party/private_membership' \ 'third_party/protobuf' \ @@ -1520,6 +1520,7 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/x11proto' \ 'third_party/xcbproto' \ 'third_party/xdg-utils' \ + 'third_party/xnnpack' \ 'third_party/zxcvbn-cpp' \ 'third_party/zlib' \ 'third_party/zlib/google' \ @@ -2172,6 +2173,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Wed Jun 22 2022 Tom Callaway - 103.0.5060.53-1 +- update to 103.0.5060.53 + * Thu Jun 16 2022 Tom Callaway - 102.0.5005.115-2 - fix minizip Requires for EL9 diff --git a/sources b/sources index 8f49caa..0cd6d37 100644 --- a/sources +++ b/sources @@ -21,4 +21,4 @@ SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1d SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a SHA512 (node-v12.22.6-linux-arm64.tar.xz) = 87ce5eb954deb1d0debe6fa02b28a3cc675e12fca1e51d44b123ab294aa39ce0c6b8ac9eae1e7a6e32673ea2c2d480651d9ba7eea73012f0529503eebe9eb34d SHA512 (node-v12.22.6-linux-x64.tar.xz) = e1b55c32343cb2ccc40d888c705414bebf9c46b02083d13731df79b1e79521b7277761f6bcca041e40e3a2e47c67bb8e7848aa2b919a9de5c2ebf62c4a9c7176 -SHA512 (chromium-102.0.5005.115-clean.tar.xz) = 43482534f96ced335073a1136f4b292bee8a9a0c31cd4b12675739b15ddb5d5351fea17b9445b36e80bccb37e086578274a5bd643a906e70d05230be136d7fc8 +SHA512 (chromium-103.0.5060.53-clean.tar.xz) = 2fe8695a291e483053e014a507d695e1efa547a276d170e9e082a539d47364a8cb78892c3e0ed26fcf4b1418ff43a56c7d582997215c633e71f3620dfb474db9 From b98b064928bbc2974da48dc8b1037094cf4787cd Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Wed, 29 Jun 2022 09:18:57 -0400 Subject: [PATCH 105/659] disable use_all_cpus --- chromium.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chromium.spec b/chromium.spec index b434039..c30e310 100644 --- a/chromium.spec +++ b/chromium.spec @@ -7,7 +7,7 @@ # This flag is so I can build things very fast on a giant system. # Enabling this in koji causes aarch64 builds to timeout indefinitely. -%global use_all_cpus 1 +%global use_all_cpus 0 %if %{use_all_cpus} %global numjobs %{_smp_build_ncpus} From 7de558c0a932c8864ddde3bb44ece158383401ec Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Thu, 30 Jun 2022 15:45:07 -0400 Subject: [PATCH 106/659] remove U mode from tools/grit to support modern Python3 --- ...060.53-python3-do-not-use-deprecated-mode-U.patch | 12 ++++++++++++ chromium.spec | 4 ++++ 2 files changed, 16 insertions(+) create mode 100644 chromium-103.0.5060.53-python3-do-not-use-deprecated-mode-U.patch diff --git a/chromium-103.0.5060.53-python3-do-not-use-deprecated-mode-U.patch b/chromium-103.0.5060.53-python3-do-not-use-deprecated-mode-U.patch new file mode 100644 index 0000000..e24f9d8 --- /dev/null +++ b/chromium-103.0.5060.53-python3-do-not-use-deprecated-mode-U.patch @@ -0,0 +1,12 @@ +diff -up chromium-103.0.5060.53/tools/grit/grit/util.py.fix-python3 chromium-103.0.5060.53/tools/grit/grit/util.py +--- chromium-103.0.5060.53/tools/grit/grit/util.py.fix-python3 2022-06-30 19:38:05.483590098 +0000 ++++ chromium-103.0.5060.53/tools/grit/grit/util.py 2022-06-30 19:38:14.024304827 +0000 +@@ -209,7 +209,7 @@ def ReadFile(filename, encoding): + mode = 'rb' + encoding = None + else: +- mode = 'rU' ++ mode = 'r' + + with io.open(filename, mode, encoding=encoding) as f: + return f.read() diff --git a/chromium.spec b/chromium.spec index c30e310..28a3bf5 100644 --- a/chromium.spec +++ b/chromium.spec @@ -299,6 +299,9 @@ Patch64: chromium-91.0.4472.77-aarch64-cxxflags-addition.patch # https://bugs.chromium.org/p/chromium/issues/detail?id=1192875 Patch65: chromium-91.0.4472.77-java-only-allowed-in-android-builds.patch +# Python3.9 or later no longer support the 'U' mode +Patch66: chromium-103.0.5060.53-python3-do-not-use-deprecated-mode-U.patch + # Fix missing cstring in remoting code Patch67: chromium-98.0.4758.80-remoting-cstring.patch # Apply fix_textrels hack for i686 (even without lld) @@ -1021,6 +1024,7 @@ udev. %patch63 -p1 -b .gcc-cfi-fix %patch64 -p1 -b .aarch64-cxxflags-addition %patch65 -p1 -b .java-only-allowed +%patch66 -p1 -b .python3-do-not-use-deprecated-mode-U %patch67 -p1 -b .remoting-cstring %patch68 -p1 -b .i686-textrels %patch79 -p1 -b .widevine-no-download From 73a370af509dad6fe34701b239813116d33d3acb Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Fri, 1 Jul 2022 16:41:10 -0400 Subject: [PATCH 107/659] update rjsmin to 1.2.0 to see if Python 3.11 likes it better --- ...103.0.5060.53-update-rjsmin-to-1.2.0.patch | 1701 +++++++++++++++++ chromium.spec | 4 + 2 files changed, 1705 insertions(+) create mode 100644 chromium-103.0.5060.53-update-rjsmin-to-1.2.0.patch diff --git a/chromium-103.0.5060.53-update-rjsmin-to-1.2.0.patch b/chromium-103.0.5060.53-update-rjsmin-to-1.2.0.patch new file mode 100644 index 0000000..9ccd1a0 --- /dev/null +++ b/chromium-103.0.5060.53-update-rjsmin-to-1.2.0.patch @@ -0,0 +1,1701 @@ +diff -up chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/rjsmin.c.12 chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/rjsmin.c +--- chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/rjsmin.c.12 2022-06-28 12:50:10.167324583 +0000 ++++ chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/rjsmin.c 2021-11-14 19:50:55.000000000 +0000 +@@ -1,5 +1,5 @@ + /* +- * Copyright 2011 - 2015 ++ * Copyright 2011 - 2021 + * Andr\xe9 Malo or his licensors, as applicable + * + * Licensed under the Apache License, Version 2.0 (the "License"); +@@ -18,21 +18,21 @@ + #include "cext.h" + EXT_INIT_FUNC; + +-#define RJSMIN_DULL_BIT (1 << 0) +-#define RJSMIN_PRE_REGEX_BIT (1 << 1) +-#define RJSMIN_REGEX_DULL_BIT (1 << 2) +-#define RJSMIN_REGEX_CC_DULL_BIT (1 << 3) +-#define RJSMIN_ID_LIT_BIT (1 << 4) +-#define RJSMIN_ID_LIT_O_BIT (1 << 5) +-#define RJSMIN_ID_LIT_C_BIT (1 << 6) +-#define RJSMIN_STRING_DULL_BIT (1 << 7) +-#define RJSMIN_SPACE_BIT (1 << 8) +-#define RJSMIN_POST_REGEX_OFF_BIT (1 << 9) ++#define RJSMIN_DULL_BIT (1 << 0) ++#define RJSMIN_PRE_REGEX_BIT (1 << 1) ++#define RJSMIN_REGEX_DULL_BIT (1 << 2) ++#define RJSMIN_REGEX_CC_DULL_BIT (1 << 3) ++#define RJSMIN_ID_LIT_BIT (1 << 4) ++#define RJSMIN_ID_LIT_O_BIT (1 << 5) ++#define RJSMIN_ID_LIT_C_BIT (1 << 6) ++#define RJSMIN_STRING_DULL_BIT (1 << 7) ++#define RJSMIN_SPACE_BIT (1 << 8) ++#define RJSMIN_POST_REGEX_OFF_BIT (1 << 9) ++#define RJSMIN_A_Z_BIT (1 << 10) + +-#ifdef EXT3 +-typedef Py_UNICODE rchar; +-#else + typedef unsigned char rchar; ++#ifdef U ++#undef U + #endif + #define U(c) ((rchar)(c)) + +@@ -66,66 +66,120 @@ typedef unsigned char rchar; + #define RJSMIN_IS_PRE_REGEX_1(c) ((U(c) <= 127) && \ + (rjsmin_charmask[U(c) & 0x7F] & RJSMIN_PRE_REGEX_BIT)) + ++#define RJSMIN_IS_A_Z(c) ((U(c) <= 127) && \ ++ (rjsmin_charmask[U(c) & 0x7F] & RJSMIN_A_Z_BIT)) ++ + + static const unsigned short rjsmin_charmask[128] = { +- 396, 396, 396, 396, 396, 396, 396, 396, +- 396, 396, 2, 396, 396, 2, 396, 396, +- 396, 396, 396, 396, 396, 396, 396, 396, +- 396, 396, 396, 396, 396, 396, 396, 396, +- 396, 687, 588, 653, 765, 653, 143, 588, +- 687, 205, 653, 237, 143, 237, 141, 648, +- 765, 765, 765, 765, 765, 765, 765, 765, +- 765, 765, 143, 143, 653, 143, 653, 143, +- 653, 765, 765, 765, 765, 765, 765, 765, +- 765, 765, 765, 765, 765, 765, 765, 765, +- 765, 765, 765, 765, 765, 765, 765, 765, +- 765, 765, 765, 683, 513, 197, 653, 765, +- 653, 765, 765, 765, 765, 765, 765, 765, +- 765, 765, 765, 765, 765, 765, 765, 765, +- 765, 765, 765, 765, 765, 765, 765, 765, +- 765, 765, 765, 687, 143, 207, 653, 765 ++ 396, 396, 396, 396, 396, 396, 396, 396, ++ 396, 396, 2, 396, 396, 2, 396, 396, ++ 396, 396, 396, 396, 396, 396, 396, 396, ++ 396, 396, 396, 396, 396, 396, 396, 396, ++ 396, 687, 588, 653, 765, 653, 143, 588, ++ 687, 205, 655, 239, 143, 239, 141, 648, ++ 765, 765, 765, 765, 765, 765, 765, 765, ++ 765, 765, 143, 143, 653, 143, 653, 143, ++ 653, 765, 765, 765, 765, 765, 765, 765, ++ 765, 765, 765, 765, 765, 765, 765, 765, ++ 765, 765, 765, 765, 765, 765, 765, 765, ++ 765, 765, 765, 683, 513, 197, 653, 765, ++ 588, 1789, 1789, 1789, 1789, 1789, 1789, 1789, ++ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, ++ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, ++ 1789, 1789, 1789, 687, 143, 207, 653, 765 + }; + ++ + static Py_ssize_t + rjsmin(const rchar *source, rchar *target, Py_ssize_t length, + int keep_bang_comments) + { +- const rchar *reset, *pcreset = NULL, *pctoken = NULL, *xtarget, +- *sentinel = source + length; +- rchar *tstart = target; +- int post_regex = 0; +- rchar c, quote, spaced = U(' '); ++ const rchar ++ *sentinel = source + length, /* never hit this pointer (source buf) */ ++ *reset, /* reset pointer (source buf) */ ++ *pcreset = NULL, /* pre-comment reset pointer (source buf) */ ++ *pctoken = NULL, /* pre-comment token pointer (target buf) ++ * Pointing to before the last kept comment, if any */ ++ *rsreset = NULL, /* regex-with-method reset pointer (source buf) */ ++ *xtarget; /* pre-regex-2 target pointer */ ++ ++ rchar *tstart = target, /* Target start pointer for reference */ ++ *rtreset = NULL; /* regex-with-method reset pointer (target buf) */ ++ ++ int rsdot, /* seen dot after regex-with-method pattern? */ ++ post_regex = 0; ++ rchar c, quote, ++ spaced = U(' '); /* the last seen kind of space (nl taking prio), ++ * init with ' ' */ + ++ /* main loop */ + while (source < sentinel) { + c = *source++; ++ + if (RJSMIN_IS_DULL(c)) { + if (post_regex) post_regex = 0; + if (pctoken) pctoken = NULL; + if (spaced == U('\n')) spaced = U(' '); ++ if (rsreset) { ++ /* both a-z and . are covered by "dull" */ ++ if (!rsdot) { ++ if (c != U('.')) { ++ /* reset regex-with-method to the starting slash */ ++ source = rsreset; ++ target = rtreset; ++ rsreset = NULL; ++ continue; /* main loop */ ++ } ++ /* Found a dot after possible regex, looking for a-z now */ ++ rsdot = 1; ++ } ++ else if (!RJSMIN_IS_A_Z(c)) { ++ /* reset regex-with-method to the starting slash */ ++ source = rsreset; ++ target = rtreset; ++ rsreset = NULL; ++ continue; /* main loop */ ++ } ++ else { ++ /* Successfull finish the regex-with-method match */ ++ rsreset = NULL; ++ } ++ } + + *target++ = c; +- continue; ++ continue; /* main loop */ + } ++ + switch (c) { + + /* String */ +- case U('\''): case U('"'): ++ case U('\''): case U('"'): case U('`'): + if (post_regex) post_regex = 0; + if (pctoken) pctoken = NULL; + if (spaced == U('\n')) spaced = U(' '); ++ if (rsreset) { ++ /* reset regex-with-method to the starting slash */ ++ source = rsreset; ++ target = rtreset; ++ rsreset = NULL; ++ continue; /* main loop */ ++ } + + reset = source; + *target++ = quote = c; ++ ++ /* string loop */ + while (source < sentinel) { + c = *source++; + *target++ = c; + if (RJSMIN_IS_STRING_DULL(c)) +- continue; ++ continue; /* string loop */ ++ + switch (c) { +- case U('\''): case U('"'): ++ case U('\''): case U('"'): case U('`'): + if (c == quote) +- goto cont; +- continue; ++ goto cont; /* main loop */ ++ continue; /* string loop */ + case U('\\'): + if (source < sentinel) { + c = *source++; +@@ -134,13 +188,18 @@ rjsmin(const rchar *source, rchar *targe + && *source == U('\n')) + *target++ = *source++; + } +- continue; ++ continue; /* string loop */ ++ case U('\r'): case U('\n'): ++ if (quote != U('`')) ++ break; /* string reset */ ++ continue; /* string loop */ + } +- break; ++ break; /* string reset */ + } ++ /* string reset */ + target -= source - reset; + source = reset; +- continue; ++ continue; /* main loop */ + + /* Comment or Regex or something else entirely */ + case U('/'): +@@ -148,6 +207,13 @@ rjsmin(const rchar *source, rchar *targe + if (post_regex) post_regex = 0; + if (pctoken) pctoken = NULL; + if (spaced == U('\n')) spaced = U(' '); ++ if (rsreset) { ++ /* reset regex-with-method to the starting slash */ ++ source = rsreset; ++ target = rtreset; ++ rsreset = NULL; ++ continue; /* main loop */ ++ } + + *target++ = c; + } +@@ -157,7 +223,19 @@ rjsmin(const rchar *source, rchar *targe + case U('*'): case U('/'): + goto skip_or_copy_ws; + ++ /* Regex or slash */ + default: ++ if (rsreset) { ++ /* reset regex-with-method to the starting slash */ ++ if (post_regex) post_regex = 0; ++ if (pctoken) pctoken = NULL; ++ if (spaced == U('\n')) spaced = U(' '); ++ source = rsreset; ++ target = rtreset; ++ rsreset = NULL; ++ continue; /* main loop */ ++ } ++ + xtarget = NULL; + if ( target == tstart + || RJSMIN_IS_PRE_REGEX_1(*((pctoken ? pctoken : target) +@@ -176,99 +254,148 @@ rjsmin(const rchar *source, rchar *targe + || !RJSMIN_IS_ID_LITERAL(*(xtarget - 7)) + ) + )) { +- +- /* Regex */ ++ /* nothing to do here, continuing down below ++ * We could unset rsreset here, but we know it already ++ * is. */ ++ ; ++ } ++ else if (*((pctoken ? pctoken : target) - 1) == U(')')) { ++ xtarget = NULL; ++ rsreset = source; ++ rtreset = target + 1; ++ rsdot = 0; ++ } ++ else { ++ /* Just a slash */ + if (post_regex) post_regex = 0; + if (pctoken) pctoken = NULL; ++ if (spaced == U('\n')) spaced = U(' '); + +- reset = source; +- if (spaced == U('\n')) { +- spaced = U(' '); +- if (xtarget) +- *target++ = U('\n'); +- } ++ *target++ = c; ++ continue; /* main loop */ ++ } + +- *target++ = U('/'); +- while (source < sentinel) { +- c = *source++; +- *target++ = c; +- if (RJSMIN_IS_REGEX_DULL(c)) +- continue; +- switch (c) { +- case U('/'): +- post_regex = 1; +- goto cont; +- case U('\\'): +- if (source < sentinel) { +- c = *source++; +- *target++ = c; +- if (c == U('\r') || c == U('\n')) +- break; +- } +- continue; +- case U('['): +- while (source < sentinel) { +- c = *source++; +- *target++ = c; +- if (RJSMIN_IS_REGEX_CC_DULL(c)) +- continue; +- switch (c) { +- case U('\\'): +- if (source < sentinel) { +- c = *source++; +- *target++ = c; +- if (c == U('\r') || c == U('\n')) +- break; +- } +- continue; +- case U(']'): +- goto cont_regex; ++ if (post_regex) post_regex = 0; ++ if (pctoken) pctoken = NULL; ++ ++ reset = source; ++ if (spaced == U('\n')) { ++ spaced = U(' '); ++ if (xtarget) ++ *target++ = U('\n'); ++ } ++ ++ *target++ = U('/'); ++ ++ /* regex loop */ ++ while (source < sentinel) { ++ c = *source++; ++ *target++ = c; ++ ++ if (RJSMIN_IS_REGEX_DULL(c)) ++ continue; /* regex loop */ ++ ++ switch (c) { ++ case U('/'): ++ while (source < sentinel ++ && RJSMIN_IS_A_Z(*source)) ++ *target++ = *source++; ++ post_regex = !rsreset; ++ /* This check is supposed to make it faster. ++ * It doesn't. It slows it down. I wonder why... ++ */ ++ /* ++ * if (!post_regex ++ * && source < sentinel - 1 ++ * && *source == U('.') ++ * && RJSMIN_IS_A_Z(*(source + 1))) ++ * rsreset = NULL; ++ */ ++ ++ goto cont; /* main loop */ ++ ++ case U('\\'): ++ if (source < sentinel) { ++ c = *source++; ++ *target++ = c; ++ if (c == U('\r') || c == U('\n')) ++ break; /* regex reset */ ++ } ++ continue; /* regex loop */ ++ ++ case U('['): ++ /* regex CC loop */ ++ while (source < sentinel) { ++ c = *source++; ++ *target++ = c; ++ ++ if (RJSMIN_IS_REGEX_CC_DULL(c)) ++ continue; /* regex CC loop */ ++ ++ switch (c) { ++ case U('\\'): ++ if (source < sentinel) { ++ c = *source++; ++ *target++ = c; ++ if (c == U('\r') || c == U('\n')) ++ break; /* regex reset */ + } ++ continue; /* regex CC loop */ ++ ++ case U(']'): ++ goto cont_regex; /* regex loop */ + } +- break; + } +- break; +- cont_regex: +- continue; ++ break; /* regex reset */ ++ + } +- target -= source - reset; +- source = reset; +- } +- else { +- /* Just a slash */ +- if (post_regex) post_regex = 0; +- if (pctoken) pctoken = NULL; +- if (spaced == U('\n')) spaced = U(' '); ++ break; /* regex reset */ + +- *target++ = c; ++ cont_regex: ++ continue; /* regex loop */ + } +- continue; ++ ++ /* regex reset */ ++ target -= source - reset; ++ source = reset; ++ rsreset = NULL; ++ continue; /* main loop */ + } + } +- continue; ++ continue; /* main loop */ /* LCOV_EXCL_LINE */ + + /* Whitespace */ + default: + skip_or_copy_ws: ++ /* remember if we've seen a newline, start with: no */ + quote = U(' '); + --source; ++ ++ /* space loop */ + while (source < sentinel) { + c = *source++; + if (RJSMIN_IS_SPACE(c)) +- continue; ++ continue; /* space loop */ ++ + switch (c) { + case U('\r'): case U('\n'): + quote = U('\n'); +- continue; ++ continue; /* space loop */ ++ ++ /* Can only be a comment at this point ++ * (or ending prematurely) */ + case U('/'): + if (source < sentinel) { + switch (*source) { ++ ++ /* multiline comment */ + case U('*'): + reset = source++; + /* copy bang comment, if requested */ + if ( keep_bang_comments && source < sentinel + && *source == U('!')) { + if (!pctoken) { ++ /* Backtracking if ending prematurely */ + pctoken = target; + pcreset = reset; + } +@@ -276,6 +403,8 @@ rjsmin(const rchar *source, rchar *targe + *target++ = U('/'); + *target++ = U('*'); + *target++ = *source++; ++ ++ /* comment loop */ + while (source < sentinel) { + c = *source++; + *target++ = c; +@@ -283,20 +412,21 @@ rjsmin(const rchar *source, rchar *targe + && *source == U('/')) { + *target++ = *source++; + reset = NULL; +- break; ++ break; /* continue space loop */ + } + } + if (!reset) +- continue; ++ continue; /* space loop */ + ++ /* comment reset */ + target -= source - reset; + source = reset; + if (pcreset == reset) { + pctoken = NULL; + pcreset = NULL; + } +- + } ++ + /* strip regular comment */ + else { + while (source < sentinel) { +@@ -305,41 +435,52 @@ rjsmin(const rchar *source, rchar *targe + && *source == U('/')) { + ++source; + reset = NULL; +- break; ++ break; /* continue space loop */ + } + } + if (!reset) +- continue; ++ continue; /* space loop */ ++ ++ /* comment reset: fallback to slash */ + source = reset; + *target++ = U('/'); + } +- goto cont; ++ goto cont; /* main loop */ ++ ++ /* single line comment */ + case U('/'): + ++source; ++ ++ /* single line comment loop */ + while (source < sentinel) { + c = *source++; + switch (c) { + case U('\n'): +- break; ++ break; /* continue space loop */ ++ + case U('\r'): + if (source < sentinel + && *source == U('\n')) + ++source; +- break; ++ break; /* continue space loop */ ++ + default: +- continue; ++ continue; /* single line comment loop */ + } +- break; ++ break; /* continue space loop */ + } + quote = U('\n'); +- continue; ++ continue; /* space loop */ + } + } + } ++ ++ /* No more spacy character found */ + --source; +- break; ++ break; /* end space loop */ + } + ++ /* Copy a space if needed */ + if ((tstart < (pctoken ? pctoken : target) && source < sentinel) + && ((quote == U('\n') + && ((RJSMIN_IS_ID_LITERAL_CLOSE(*((pctoken ? +@@ -363,8 +504,9 @@ rjsmin(const rchar *source, rchar *targe + pcreset = NULL; + spaced = quote; + } ++ + cont: +- continue; ++ continue; /* main loop */ + } + return (Py_ssize_t)(target - tstart); + } +@@ -385,15 +527,15 @@ substitution regex.\n\ + :Note: This is a hand crafted C implementation built on the regex\n\ + semantics.\n\ + \n\ +-:Parameters:\n\ +- `script` : ``str``\n\ ++Parameters:\n\ ++ script (str):\n\ + Script to minify\n\ + \n\ +- `keep_bang_comments` : ``bool``\n\ ++ keep_bang_comments (bool):\n\ + Keep comments starting with an exclamation mark? (``/*!...*/``)\n\ + \n\ +-:Return: Minified script\n\ +-:Rtype: ``str``"); ++Returns:\n\ ++ str: Minified script"); + + static PyObject * + rjsmin_jsmin(PyObject *self, PyObject *args, PyObject *kwds) +@@ -404,15 +546,15 @@ rjsmin_jsmin(PyObject *self, PyObject *a + int keep_bang_comments; + #ifdef EXT2 + int uni; +-#define UOBJ "O" + #endif + #ifdef EXT3 +-#define UOBJ "U" ++ int bytes; ++ rchar *bytescript; + #endif + +- if (!PyArg_ParseTupleAndKeywords(args, kwds, UOBJ "|O", kwlist, ++ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O", kwlist, + &script, &keep_bang_comments_)) +- return NULL; ++ LCOV_EXCL_LINE_RETURN(NULL); + + if (!keep_bang_comments_) + keep_bang_comments = 0; +@@ -425,28 +567,27 @@ rjsmin_jsmin(PyObject *self, PyObject *a + #ifdef EXT2 + if (PyUnicode_Check(script)) { + if (!(script = PyUnicode_AsUTF8String(script))) +- return NULL; ++ LCOV_EXCL_LINE_RETURN(NULL); + uni = 1; + } ++ else if (!PyString_Check(script)) { ++ PyErr_SetString(PyExc_TypeError, "Unexpected type"); ++ return NULL; ++ } + else { + if (!(script = PyObject_Str(script))) +- return NULL; ++ LCOV_EXCL_LINE_RETURN(NULL); + uni = 0; + } +-#endif +- +-#ifdef EXT3 +- Py_INCREF(script); +-#define PyString_GET_SIZE PyUnicode_GET_SIZE +-#define PyString_AS_STRING PyUnicode_AS_UNICODE +-#define _PyString_Resize PyUnicode_Resize +-#define PyString_FromStringAndSize PyUnicode_FromUnicode +-#endif +- + slength = PyString_GET_SIZE(script); ++ + if (!(result = PyString_FromStringAndSize(NULL, slength))) { ++ LCOV_EXCL_START ++ + Py_DECREF(script); + return NULL; ++ ++ LCOV_EXCL_STOP + } + Py_BEGIN_ALLOW_THREADS + length = rjsmin((rchar *)PyString_AS_STRING(script), +@@ -456,30 +597,97 @@ rjsmin_jsmin(PyObject *self, PyObject *a + + Py_DECREF(script); + if (length < 0) { ++ LCOV_EXCL_START ++ + Py_DECREF(result); + return NULL; ++ ++ LCOV_EXCL_STOP + } + if (length != slength && _PyString_Resize(&result, length) == -1) +- return NULL; ++ LCOV_EXCL_LINE_RETURN(NULL); + +-#ifdef EXT2 + if (uni) { + script = PyUnicode_DecodeUTF8(PyString_AS_STRING(result), + PyString_GET_SIZE(result), "strict"); + Py_DECREF(result); +- if (!script) +- return NULL; +- result = script; ++ return script; + } +-#endif ++ + return result; ++ ++#else /* EXT3 */ ++ ++ if (PyUnicode_Check(script)) { ++ bytes = 0; ++ script = PyUnicode_AsUTF8String(script); ++ bytescript = (rchar *)PyBytes_AS_STRING(script); ++ slength = PyBytes_GET_SIZE(script); ++ } ++ else if (PyBytes_Check(script)) { ++ bytes = 1; ++ Py_INCREF(script); ++ bytescript = (rchar *)PyBytes_AS_STRING(script); ++ slength = PyBytes_GET_SIZE(script); ++ } ++ else if (PyByteArray_Check(script)) { ++ bytes = 2; ++ Py_INCREF(script); ++ bytescript = (rchar *)PyByteArray_AS_STRING(script); ++ slength = PyByteArray_GET_SIZE(script); ++ } ++ else { ++ PyErr_SetString(PyExc_TypeError, "Unexpected type"); ++ return NULL; ++ } ++ ++ if (!(result = PyBytes_FromStringAndSize(NULL, slength))) { ++ LCOV_EXCL_START ++ ++ Py_DECREF(script); ++ return NULL; ++ ++ LCOV_EXCL_STOP ++ } ++ Py_BEGIN_ALLOW_THREADS ++ length = rjsmin(bytescript, (rchar *)PyBytes_AS_STRING(result), ++ slength, keep_bang_comments); ++ Py_END_ALLOW_THREADS ++ ++ Py_DECREF(script); ++ if (length < 0) { ++ LCOV_EXCL_START ++ ++ Py_DECREF(result); ++ return NULL; ++ ++ LCOV_EXCL_STOP ++ } ++ ++ if (!bytes) { ++ script = PyUnicode_DecodeUTF8(PyBytes_AS_STRING(result), length, ++ "strict"); ++ Py_DECREF(result); ++ return script; ++ } ++ if (bytes == 1) { ++ if (length != slength) { ++ _PyBytes_Resize(&result, length); ++ } ++ return result; ++ } ++ /* bytes == 2: bytearray */ ++ script = PyByteArray_FromStringAndSize(PyBytes_AS_STRING(result), length); ++ Py_DECREF(result); ++ return script; ++#endif + } + + /* ------------------------ BEGIN MODULE DEFINITION ------------------------ */ + + EXT_METHODS = { + {"jsmin", +- (PyCFunction)rjsmin_jsmin, METH_VARARGS | METH_KEYWORDS, ++ EXT_CFUNC(rjsmin_jsmin), METH_VARARGS | METH_KEYWORDS, + rjsmin_jsmin__doc__}, + + {NULL} /* Sentinel */ +@@ -499,10 +707,10 @@ EXT_INIT_FUNC { + + /* Create the module and populate stuff */ + if (!(m = EXT_CREATE(&EXT_DEFINE_VAR))) +- EXT_INIT_ERROR(NULL); ++ EXT_INIT_ERROR(LCOV_EXCL_LINE(NULL)); + + EXT_ADD_UNICODE(m, "__author__", "Andr\xe9 Malo", "latin-1"); +- EXT_ADD_STRING(m, "__docformat__", "restructuredtext en"); ++ EXT_ADD_STRING(m, "__version__", STRINGIFY(EXT_VERSION)); + + EXT_INIT_RETURN(m); + } +diff -up chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/rjsmin.py.12 chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/rjsmin.py +--- chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/rjsmin.py.12 2022-07-01 20:33:39.317727375 +0000 ++++ chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/rjsmin.py 2021-11-14 20:24:16.000000000 +0000 +@@ -1,6 +1,6 @@ + #!/usr/bin/env python + # -*- coding: ascii -*- +-r""" ++u""" + ===================== + Javascript Minifier + ===================== +@@ -11,7 +11,7 @@ The minifier is based on the semantics o + + :Copyright: + +- Copyright 2011 - 2015 ++ Copyright 2011 - 2021 + Andr\xe9 Malo or his licensors, as applicable + + :License: +@@ -39,9 +39,11 @@ same results as the original ``jsmin.c`` + - Newline characters are not allowed inside string and regex literals, except + for line continuations in string literals (ECMA-5). + - "return /regex/" is recognized correctly. ++- More characters are allowed before regexes. + - Line terminators after regex literals are handled more sensibly + - "+ +" and "- -" sequences are not collapsed to '++' or '--' + - Newlines before ! operators are removed more sensibly ++- (Unnested) template literals are supported (ECMA-6) + - Comments starting with an exclamation mark (``!``) can be kept optionally + - rJSmin does not handle streams, but only complete strings. (However, the + module provides a "streamy" interface). +@@ -56,20 +58,17 @@ file for details. + + rjsmin.c is a reimplementation of rjsmin.py in C and speeds it up even more. + +-Both python 2 and python 3 are supported. ++Supported python versions are 2.7 and 3.6+. + + .. _jsmin.c by Douglas Crockford: + http://www.crockford.com/javascript/jsmin.c + """ +-if __doc__: +- # pylint: disable = redefined-builtin +- __doc__ = __doc__.encode('ascii').decode('unicode_escape') +-__author__ = r"Andr\xe9 Malo".encode('ascii').decode('unicode_escape') +-__docformat__ = "restructuredtext en" ++__author__ = u"Andr\xe9 Malo" + __license__ = "Apache License, Version 2.0" +-__version__ = '1.0.12' ++__version__ = '1.2.0' + __all__ = ['jsmin'] + ++import functools as _ft + import re as _re + + +@@ -80,13 +79,13 @@ def _make_jsmin(python_only=False): + .. _jsmin.c by Douglas Crockford: + http://www.crockford.com/javascript/jsmin.c + +- :Parameters: +- `python_only` : ``bool`` ++ Parameters: ++ python_only (bool): + Use only the python variant. If true, the c extension is not even + tried to be loaded. + +- :Return: Minifier +- :Rtype: ``callable`` ++ Returns: ++ callable: Minifier + """ + # pylint: disable = unused-variable + # pylint: disable = too-many-locals +@@ -97,7 +96,10 @@ def _make_jsmin(python_only=False): + except ImportError: + pass + else: +- return _rjsmin.jsmin ++ # Ensure that the C version is in sync ++ # https://github.com/ndparker/rjsmin/issues/11 ++ if getattr(_rjsmin, '__version__', None) == __version__: ++ return _rjsmin.jsmin + try: + xrange + except NameError: +@@ -110,15 +112,16 @@ def _make_jsmin(python_only=False): + space_comment_nobang = r'(?:/\*(?!!)[^*]*\*+(?:[^/*][^*]*\*+)*/)' + bang_comment = r'(?:/\*![^*]*\*+(?:[^/*][^*]*\*+)*/)' + +- string1 = \ +- r'(?:\047[^\047\\\r\n]*(?:\\(?:[^\r\n]|\r?\n|\r)[^\047\\\r\n]*)*\047)' ++ string1 = r"(?:'[^'\\\r\n]*(?:\\(?:[^\r\n]|\r?\n|\r)[^'\\\r\n]*)*')" ++ string1 = string1.replace("'", r'\047') # portability + string2 = r'(?:"[^"\\\r\n]*(?:\\(?:[^\r\n]|\r?\n|\r)[^"\\\r\n]*)*")' +- string3 = r'(?:`(?:[^`\\]|\\.)*`)' ++ string3 = r'(?:`[^`\\]*(?:\\(?:[^\r\n]|\r?\n|\r)[^`\\]*)*`)' ++ string3 = string3.replace('`', r'\140') # portability + strings = r'(?:%s|%s|%s)' % (string1, string2, string3) + + charclass = r'(?:\[[^\\\]\r\n]*(?:\\[^\r\n][^\\\]\r\n]*)*\])' + nospecial = r'[^/\\\[\r\n]' +- regex = r'(?:/(?![\r\n/*])%s*(?:(?:\\[^\r\n]|%s)%s*)*/)' % ( ++ regex = r'(?:/(?![\r\n/*])%s*(?:(?:\\[^\r\n]|%s)%s*)*/[a-z]*)' % ( + nospecial, charclass, nospecial + ) + space = r'(?:%s|%s)' % (space_chars, space_comment) +@@ -154,7 +157,7 @@ def _make_jsmin(python_only=False): + ) for first, last in result]) # noqa + + return _re.sub( +- r'([\000-\040\047])', # \047 for better portability ++ r"([\000-\040'`])", # ' and ` for better portability + lambda m: '\\%03o' % ord(m.group(1)), ( + sequentize(result) + .replace('\\', '\\\\') +@@ -180,42 +183,48 @@ def _make_jsmin(python_only=False): + return r'[%s]' % fix_charclass(result) + + not_id_literal = not_id_literal_(r'[a-zA-Z0-9_$]') +- preregex1 = r'[(,=:\[!&|?{};\r\n]' ++ preregex1 = r'[(,=:\[!&|?{};\r\n+*-]' + preregex2 = r'%(not_id_literal)sreturn' % locals() + + id_literal = id_literal_(r'[a-zA-Z0-9_$]') + id_literal_open = id_literal_(r'[a-zA-Z0-9_${\[(!+-]') +- id_literal_close = id_literal_(r'[a-zA-Z0-9_$}\])"\047+-]') ++ id_literal_close = id_literal_(r'[a-zA-Z0-9_$}\])"\047\140+-]') + post_regex_off = id_literal_(r'[^\000-\040}\])?:|,;.&=+-]') + +- dull = r'[^\047"`/\000-\040]' ++ dull = r'[^\047"\140/\000-\040]' + + space_sub_simple = _re.compile(( +- # noqa pylint: disable = bad-continuation ++ # noqa pylint: disable = bad-option-value, bad-continuation + + r'(%(dull)s+)' # 0 + r'|(%(strings)s%(dull)s*)' # 1 +- r'|(?<=%(preregex1)s)' ++ r'|(?<=[)])' + r'%(space)s*(?:%(newline)s%(space)s*)*' + r'(%(regex)s)' # 2 +- r'(%(space)s*(?:%(newline)s%(space)s*)+' # 3 ++ r'(?=%(space)s*(?:%(newline)s%(space)s*)*' ++ r'\.' ++ r'%(space)s*(?:%(newline)s%(space)s*)*[a-z])' ++ r'|(?<=%(preregex1)s)' ++ r'%(space)s*(?:%(newline)s%(space)s*)*' ++ r'(%(regex)s)' # 3 ++ r'(%(space)s*(?:%(newline)s%(space)s*)+' # 4 + r'(?=%(post_regex_off)s))?' + r'|(?<=%(preregex2)s)' +- r'%(space)s*(?:(%(newline)s)%(space)s*)*' # 4 +- r'(%(regex)s)' # 5 +- r'(%(space)s*(?:%(newline)s%(space)s*)+' # 6 ++ r'%(space)s*(?:(%(newline)s)%(space)s*)*' # 5 ++ r'(%(regex)s)' # 6 ++ r'(%(space)s*(?:%(newline)s%(space)s*)+' # 7 + r'(?=%(post_regex_off)s))?' + r'|(?<=%(id_literal_close)s)' +- r'%(space)s*(?:(%(newline)s)%(space)s*)+' # 7 ++ r'%(space)s*(?:(%(newline)s)%(space)s*)+' # 8 + r'(?=%(id_literal_open)s)' +- r'|(?<=%(id_literal)s)(%(space)s)+(?=%(id_literal)s)' # 8 +- r'|(?<=\+)(%(space)s)+(?=\+)' # 9 +- r'|(?<=-)(%(space)s)+(?=-)' # 10 ++ r'|(?<=%(id_literal)s)(%(space)s)+(?=%(id_literal)s)' # 9 ++ r'|(?<=\+)(%(space)s)+(?=\+)' # 10 ++ r'|(?<=-)(%(space)s)+(?=-)' # 11 + r'|%(space)s+' + r'|(?:%(newline)s%(space)s*)+' + ) % locals()).sub + +- # print space_sub_simple.__self__.pattern ++ # print(space_sub_simple.__self__.pattern) + + def space_subber_simple(match): + """ Substitution callback """ +@@ -227,48 +236,56 @@ def _make_jsmin(python_only=False): + elif groups[1]: + return groups[1] + elif groups[2]: +- if groups[3]: +- return groups[2] + '\n' + return groups[2] +- elif groups[5]: ++ elif groups[3]: ++ if groups[4]: ++ return groups[3] + '\n' ++ return groups[3] ++ elif groups[6]: + return "%s%s%s" % ( +- groups[4] and '\n' or '', +- groups[5], +- groups[6] and '\n' or '', ++ groups[5] and '\n' or '', ++ groups[6], ++ groups[7] and '\n' or '', + ) +- elif groups[7]: ++ elif groups[8]: + return '\n' +- elif groups[8] or groups[9] or groups[10]: ++ elif groups[9] or groups[10] or groups[11]: + return ' ' + else: + return '' + + space_sub_banged = _re.compile(( +- # noqa pylint: disable = bad-continuation ++ # noqa pylint: disable = bad-option-value, bad-continuation + + r'(%(dull)s+)' # 0 + r'|(%(strings)s%(dull)s*)' # 1 +- r'|(?<=%(preregex1)s)' ++ r'|(?<=[)])' + r'(%(space)s*(?:%(newline)s%(space)s*)*)' # 2 + r'(%(regex)s)' # 3 +- r'(%(space)s*(?:%(newline)s%(space)s*)+' # 4 ++ r'(?=%(space)s*(?:%(newline)s%(space)s*)*' ++ r'\.' ++ r'%(space)s*(?:%(newline)s%(space)s*)*[a-z])' ++ r'|(?<=%(preregex1)s)' ++ r'(%(space)s*(?:%(newline)s%(space)s*)*)' # 4 ++ r'(%(regex)s)' # 5 ++ r'(%(space)s*(?:%(newline)s%(space)s*)+' # 6 + r'(?=%(post_regex_off)s))?' + r'|(?<=%(preregex2)s)' +- r'(%(space)s*(?:(%(newline)s)%(space)s*)*)' # 5, 6 +- r'(%(regex)s)' # 7 +- r'(%(space)s*(?:%(newline)s%(space)s*)+' # 8 ++ r'(%(space)s*(?:(%(newline)s)%(space)s*)*)' # 7, 8 ++ r'(%(regex)s)' # 9 ++ r'(%(space)s*(?:%(newline)s%(space)s*)+' # 10 + r'(?=%(post_regex_off)s))?' + r'|(?<=%(id_literal_close)s)' +- r'(%(space)s*(?:%(newline)s%(space)s*)+)' # 9 ++ r'(%(space)s*(?:%(newline)s%(space)s*)+)' # 11 + r'(?=%(id_literal_open)s)' +- r'|(?<=%(id_literal)s)(%(space)s+)(?=%(id_literal)s)' # 10 +- r'|(?<=\+)(%(space)s+)(?=\+)' # 11 +- r'|(?<=-)(%(space)s+)(?=-)' # 12 +- r'|(%(space)s+)' # 13 +- r'|((?:%(newline)s%(space)s*)+)' # 14 ++ r'|(?<=%(id_literal)s)(%(space)s+)(?=%(id_literal)s)' # 12 ++ r'|(?<=\+)(%(space)s+)(?=\+)' # 13 ++ r'|(?<=-)(%(space)s+)(?=-)' # 14 ++ r'|(%(space)s+)' # 15 ++ r'|((?:%(newline)s%(space)s*)+)' # 16 + ) % locals()).sub + +- # print space_sub_banged.__self__.pattern ++ # print(space_sub_banged.__self__.pattern) + + keep = _re.compile(( + r'%(space_chars)s+|%(space_comment_nobang)s+|%(newline)s+' +@@ -276,7 +293,7 @@ def _make_jsmin(python_only=False): + ) % locals()).sub + keeper = lambda m: m.groups()[0] or '' + +- # print keep.__self__.pattern ++ # print(keep.__self__.pattern) + + def space_subber_banged(match): + """ Substitution callback """ +@@ -288,26 +305,34 @@ def _make_jsmin(python_only=False): + elif groups[1]: + return groups[1] + elif groups[3]: +- return "%s%s%s%s" % ( ++ return "%s%s" % ( + keep(keeper, groups[2]), + groups[3], +- keep(keeper, groups[4] or ''), +- groups[4] and '\n' or '', + ) +- elif groups[7]: +- return "%s%s%s%s%s" % ( +- keep(keeper, groups[5]), ++ elif groups[5]: ++ return "%s%s%s%s" % ( ++ keep(keeper, groups[4]), ++ groups[5], ++ keep(keeper, groups[6] or ''), + groups[6] and '\n' or '', +- groups[7], +- keep(keeper, groups[8] or ''), +- groups[8] and '\n' or '', + ) + elif groups[9]: +- return keep(keeper, groups[9]) + '\n' +- elif groups[10] or groups[11] or groups[12]: +- return keep(keeper, groups[10] or groups[11] or groups[12]) or ' ' ++ return "%s%s%s%s%s" % ( ++ keep(keeper, groups[7]), ++ groups[8] and '\n' or '', ++ groups[9], ++ keep(keeper, groups[10] or ''), ++ groups[10] and '\n' or '', ++ ) ++ elif groups[11]: ++ return keep(keeper, groups[11]) + '\n' ++ elif groups[12] or groups[13] or groups[14]: ++ return keep(keeper, groups[12] or groups[13] or groups[14]) or ' ' + else: +- return keep(keeper, groups[13] or groups[14]) ++ return keep(keeper, groups[15] or groups[16]) ++ ++ banged = _ft.partial(space_sub_banged, space_subber_banged) ++ simple = _ft.partial(space_sub_simple, space_subber_simple) + + def jsmin(script, keep_bang_comments=False): + r""" +@@ -320,32 +345,51 @@ def _make_jsmin(python_only=False): + .. _jsmin.c by Douglas Crockford: + http://www.crockford.com/javascript/jsmin.c + +- :Parameters: +- `script` : ``str`` ++ Parameters: ++ script (str): + Script to minify + +- `keep_bang_comments` : ``bool`` ++ keep_bang_comments (bool): + Keep comments starting with an exclamation mark? (``/*!...*/``) + +- :Return: Minified script +- :Rtype: ``str`` ++ Returns: ++ str: Minified script + """ + # pylint: disable = redefined-outer-name + +- if keep_bang_comments: +- return space_sub_banged( +- space_subber_banged, '\n%s\n' % script +- ).strip() +- else: +- return space_sub_simple( +- space_subber_simple, '\n%s\n' % script +- ).strip() ++ is_bytes, script = _as_str(script) ++ script = (banged if keep_bang_comments else simple)( ++ '\n%s\n' % script ++ ).strip() ++ if is_bytes: ++ script = script.encode('latin-1') ++ if is_bytes == 2: ++ script = bytearray(script) ++ return script + + return jsmin + + jsmin = _make_jsmin() + + ++def _as_str(script): ++ """ Make sure the script is a text string """ ++ is_bytes = False ++ if str is bytes: ++ if not isinstance(script, basestring): # noqa pylint: disable = undefined-variable ++ raise TypeError("Unexpected type") ++ elif isinstance(script, bytes): ++ is_bytes = True ++ script = script.decode('latin-1') ++ elif isinstance(script, bytearray): ++ is_bytes = 2 ++ script = script.decode('latin-1') ++ elif not isinstance(script, str): ++ raise TypeError("Unexpected type") ++ ++ return is_bytes, script ++ ++ + def jsmin_for_posers(script, keep_bang_comments=False): + r""" + Minify javascript based on `jsmin.c by Douglas Crockford`_\. +@@ -361,49 +405,61 @@ def jsmin_for_posers(script, keep_bang_c + utilizes the resulting regexes. It's here for fun and may + vanish any time. Use the `jsmin` function instead. + +- :Parameters: +- `script` : ``str`` ++ Parameters: ++ script (str): + Script to minify + +- `keep_bang_comments` : ``bool`` ++ keep_bang_comments (bool): + Keep comments starting with an exclamation mark? (``/*!...*/``) + +- :Return: Minified script +- :Rtype: ``str`` ++ Returns: ++ str: Minified script + """ + if not keep_bang_comments: + rex = ( +- r'([^\047"/\000-\040]+)|((?:(?:\047[^\047\\\r\n]*(?:\\(?:[^\r\n]' +- r'|\r?\n|\r)[^\047\\\r\n]*)*\047)|(?:"[^"\\\r\n]*(?:\\(?:[^\r\n]' +- r'|\r?\n|\r)[^"\\\r\n]*)*"))[^\047"/\000-\040]*)|(?<=[(,=:\[!&|?' +- r'{};\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*' +- r'][^*]*\*+)*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\0' +- r'14\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)*((?:/(?![\r' +- r'\n/*])[^/\\\[\r\n]*(?:(?:\\[^\r\n]|(?:\[[^\\\]\r\n]*(?:\\[^\r' +- r'\n][^\\\]\r\n]*)*\]))[^/\\\[\r\n]*)*/))((?:[\000-\011\013\014' ++ r'([^\047"\140/\000-\040]+)|((?:(?:\047[^\047\\\r\n]*(?:\\(?:[^' ++ r'\r\n]|\r?\n|\r)[^\047\\\r\n]*)*\047)|(?:"[^"\\\r\n]*(?:\\(?:[^' ++ r'\r\n]|\r?\n|\r)[^"\\\r\n]*)*")|(?:\140[^\140\\]*(?:\\(?:[^\r\n' ++ r']|\r?\n|\r)[^\140\\]*)*\140))[^\047"\140/\000-\040]*)|(?<=[)])' ++ r'(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+' ++ r')*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-\0' ++ r'40]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)*((?:/(?![\r\n/*])[^/' ++ r'\\\[\r\n]*(?:(?:\\[^\r\n]|(?:\[[^\\\]\r\n]*(?:\\[^\r\n][^\\\]' ++ r'\r\n]*)*\]))[^/\\\[\r\n]*)*/[a-z]*))(?=(?:[\000-\011\013\014\0' ++ r'16-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^\r\n' ++ r']*)?[\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^' ++ r'/*][^*]*\*+)*/))*)*\.(?:[\000-\011\013\014\016-\040]|(?:/\*[^*' ++ r']*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\00' ++ r'0-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)' ++ r'*[a-z])|(?<=[(,=:\[!&|?{};\r\n+*-])(?:[\000-\011\013\014\016-' ++ r'\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^\r\n]*)' ++ r'?[\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*]' ++ r'[^*]*\*+)*/))*)*((?:/(?![\r\n/*])[^/\\\[\r\n]*(?:(?:\\[^\r\n]|' ++ r'(?:\[[^\\\]\r\n]*(?:\\[^\r\n][^\\\]\r\n]*)*\]))[^/\\\[\r\n]*)*' ++ r'/[a-z]*))((?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/' ++ r'*][^*]*\*+)*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013' ++ r'\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)+(?=[^\000' ++ r'-\040&)+,.:;=?\]|}-]))?|(?<=[\000-#%-,./:-@\[-^\140{-~-]return' ++ r')(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*' ++ r'+)*/))*(?:((?:(?://[^\r\n]*)?[\r\n]))(?:[\000-\011\013\014\016' ++ r'-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)*((?:/(?![\r\n/*])' ++ r'[^/\\\[\r\n]*(?:(?:\\[^\r\n]|(?:\[[^\\\]\r\n]*(?:\\[^\r\n][^' ++ r'\\\]\r\n]*)*\]))[^/\\\[\r\n]*)*/[a-z]*))((?:[\000-\011\013\014' + r'\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^\r' + r'\n]*)?[\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:' +- r'[^/*][^*]*\*+)*/))*)+(?=[^\000-\040&)+,.:;=?\]|}-]))?|(?<=[\00' +- r'0-#%-,./:-@\[-^`{-~-]return)(?:[\000-\011\013\014\016-\040]|(?' +- r':/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:((?:(?://[^\r\n]*)?[\r\n]' +- r'))(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*' +- r'\*+)*/))*)*((?:/(?![\r\n/*])[^/\\\[\r\n]*(?:(?:\\[^\r\n]|(?:\[' +- r'[^\\\]\r\n]*(?:\\[^\r\n][^\\\]\r\n]*)*\]))[^/\\\[\r\n]*)*/))((' +- r'?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)' +- r'*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-\04' +- r'0]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)+(?=[^\000-\040&)+,.:;' +- r'=?\]|}-]))?|(?<=[^\000-!#%&(*,./:-@\[\\^`{|~])(?:[\000-\011\01' +- r'3\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:((?:(?:' +- r'//[^\r\n]*)?[\r\n]))(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]' +- r'*\*+(?:[^/*][^*]*\*+)*/))*)+(?=[^\000-\040"#%-\047)*,./:-@\\-^' +- r'`|-~])|(?<=[^\000-#%-,./:-@\[-^`{-~-])((?:[\000-\011\013\014\0' +- r'16-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/)))+(?=[^\000-#%-,./' +- r':-@\[-^`{-~-])|(?<=\+)((?:[\000-\011\013\014\016-\040]|(?:/\*[' +- r'^*]*\*+(?:[^/*][^*]*\*+)*/)))+(?=\+)|(?<=-)((?:[\000-\011\013' +- r'\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/)))+(?=-)|(?:[' +- r'\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/)' +- r')+|(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-\040]' +- r'|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)+' ++ r'[^/*][^*]*\*+)*/))*)+(?=[^\000-\040&)+,.:;=?\]|}-]))?|(?<=[^\0' ++ r'00-!#%&(*,./:-@\[\\^{|~])(?:[\000-\011\013\014\016-\040]|(?:/' ++ r'\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:((?:(?://[^\r\n]*)?[\r\n]))' ++ r'(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+' ++ r')*/))*)+(?=[^\000-\040"#%-\047)*,./:-@\\-^\140|-~])|(?<=[^\000' ++ r'-#%-,./:-@\[-^\140{-~-])((?:[\000-\011\013\014\016-\040]|(?:/' ++ r'\*[^*]*\*+(?:[^/*][^*]*\*+)*/)))+(?=[^\000-#%-,./:-@\[-^\140{-' ++ r'~-])|(?<=\+)((?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:' ++ r'[^/*][^*]*\*+)*/)))+(?=\+)|(?<=-)((?:[\000-\011\013\014\016-\0' ++ r'40]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/)))+(?=-)|(?:[\000-\011\0' ++ r'13\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))+|(?:(?:(?' ++ r'://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]' ++ r'*\*+(?:[^/*][^*]*\*+)*/))*)+' + ) + + def subber(match): +@@ -412,59 +468,72 @@ def jsmin_for_posers(script, keep_bang_c + return ( + groups[0] or + groups[1] or +- (groups[3] and (groups[2] + '\n')) or + groups[2] or +- (groups[5] and "%s%s%s" % ( +- groups[4] and '\n' or '', +- groups[5], +- groups[6] and '\n' or '', ++ (groups[4] and (groups[3] + '\n')) or ++ groups[3] or ++ (groups[6] and "%s%s%s" % ( ++ groups[5] and '\n' or '', ++ groups[6], ++ groups[7] and '\n' or '', + )) or +- (groups[7] and '\n') or +- (groups[8] and ' ') or ++ (groups[8] and '\n') or + (groups[9] and ' ') or + (groups[10] and ' ') or ++ (groups[11] and ' ') or + '' + ) + else: + rex = ( +- r'([^\047"/\000-\040]+)|((?:(?:\047[^\047\\\r\n]*(?:\\(?:[^\r\n]' +- r'|\r?\n|\r)[^\047\\\r\n]*)*\047)|(?:"[^"\\\r\n]*(?:\\(?:[^\r\n]' +- r'|\r?\n|\r)[^"\\\r\n]*)*"))[^\047"/\000-\040]*)|(?<=[(,=:\[!&|?' +- r'{};\r\n])((?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/' +- r'*][^*]*\*+)*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013' +- r'\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)*)((?:/(?!' +- r'[\r\n/*])[^/\\\[\r\n]*(?:(?:\\[^\r\n]|(?:\[[^\\\]\r\n]*(?:\\[^' +- r'\r\n][^\\\]\r\n]*)*\]))[^/\\\[\r\n]*)*/))((?:[\000-\011\013\01' +- r'4\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^' ++ r'([^\047"\140/\000-\040]+)|((?:(?:\047[^\047\\\r\n]*(?:\\(?:[^' ++ r'\r\n]|\r?\n|\r)[^\047\\\r\n]*)*\047)|(?:"[^"\\\r\n]*(?:\\(?:[^' ++ r'\r\n]|\r?\n|\r)[^"\\\r\n]*)*")|(?:\140[^\140\\]*(?:\\(?:[^\r\n' ++ r']|\r?\n|\r)[^\140\\]*)*\140))[^\047"\140/\000-\040]*)|(?<=[)])' ++ r'((?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*' ++ r'+)*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-' ++ r'\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)*)((?:/(?![\r\n/*])' ++ r'[^/\\\[\r\n]*(?:(?:\\[^\r\n]|(?:\[[^\\\]\r\n]*(?:\\[^\r\n][^' ++ r'\\\]\r\n]*)*\]))[^/\\\[\r\n]*)*/[a-z]*))(?=(?:[\000-\011\013\0' ++ r'14\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^' + r'\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(' +- r'?:[^/*][^*]*\*+)*/))*)+(?=[^\000-\040&)+,.:;=?\]|}-]))?|(?<=[' +- r'\000-#%-,./:-@\[-^`{-~-]return)((?:[\000-\011\013\014\016-\040' +- r']|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:((?:(?://[^\r\n]*)?[' +- r'\r\n]))(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][' +- r'^*]*\*+)*/))*)*)((?:/(?![\r\n/*])[^/\\\[\r\n]*(?:(?:\\[^\r\n]|' +- r'(?:\[[^\\\]\r\n]*(?:\\[^\r\n][^\\\]\r\n]*)*\]))[^/\\\[\r\n]*)*' +- r'/))((?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]' +- r'*\*+)*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\01' +- r'6-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)+(?=[^\000-\040&)' +- r'+,.:;=?\]|}-]))?|(?<=[^\000-!#%&(*,./:-@\[\\^`{|~])((?:[\000-' +- r'\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:' +- r'(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-\040]|(?:/' +- r'\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)+)(?=[^\000-\040"#%-\047)*,./' +- r':-@\\-^`|-~])|(?<=[^\000-#%-,./:-@\[-^`{-~-])((?:[\000-\011\01' +- r'3\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))+)(?=[^\000' +- r'-#%-,./:-@\[-^`{-~-])|(?<=\+)((?:[\000-\011\013\014\016-\040]|' +- r'(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))+)(?=\+)|(?<=-)((?:[\000-\0' +- r'11\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))+)(?=-' +- r')|((?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*' +- r'\*+)*/))+)|((?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014' +- r'\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)+)' ++ r'?:[^/*][^*]*\*+)*/))*)*\.(?:[\000-\011\013\014\016-\040]|(?:/' ++ r'\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?' ++ r':[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*' ++ r'/))*)*[a-z])|(?<=[(,=:\[!&|?{};\r\n+*-])((?:[\000-\011\013\014' ++ r'\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^\r' ++ r'\n]*)?[\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:' ++ r'[^/*][^*]*\*+)*/))*)*)((?:/(?![\r\n/*])[^/\\\[\r\n]*(?:(?:\\[^' ++ r'\r\n]|(?:\[[^\\\]\r\n]*(?:\\[^\r\n][^\\\]\r\n]*)*\]))[^/\\\[\r' ++ r'\n]*)*/[a-z]*))((?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+' ++ r'(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\01' ++ r'1\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)+(?=[' ++ r'^\000-\040&)+,.:;=?\]|}-]))?|(?<=[\000-#%-,./:-@\[-^\140{-~-]r' ++ r'eturn)((?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][' ++ r'^*]*\*+)*/))*(?:((?:(?://[^\r\n]*)?[\r\n]))(?:[\000-\011\013\0' ++ r'14\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)*)((?:/(?![' ++ r'\r\n/*])[^/\\\[\r\n]*(?:(?:\\[^\r\n]|(?:\[[^\\\]\r\n]*(?:\\[^' ++ r'\r\n][^\\\]\r\n]*)*\]))[^/\\\[\r\n]*)*/[a-z]*))((?:[\000-\011' ++ r'\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(' ++ r'?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*' ++ r']*\*+(?:[^/*][^*]*\*+)*/))*)+(?=[^\000-\040&)+,.:;=?\]|}-]))?|' ++ r'(?<=[^\000-!#%&(*,./:-@\[\\^{|~])((?:[\000-\011\013\014\016-\0' ++ r'40]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^\r\n]*)?[' ++ r'\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^' ++ r'*]*\*+)*/))*)+)(?=[^\000-\040"#%-\047)*,./:-@\\-^\140|-~])|(?<' ++ r'=[^\000-#%-,./:-@\[-^\140{-~-])((?:[\000-\011\013\014\016-\040' ++ r']|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))+)(?=[^\000-#%-,./:-@\[-^' ++ r'\140{-~-])|(?<=\+)((?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*' ++ r'\*+(?:[^/*][^*]*\*+)*/))+)(?=\+)|(?<=-)((?:[\000-\011\013\014' ++ r'\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))+)(?=-)|((?:[\00' ++ r'0-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))+)' ++ r'|((?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-\040]|' ++ r'(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)+)' + ) + +- keep = _re.compile(( ++ keep = _re.compile( + r'[\000-\011\013\014\016-\040]+|(?:/\*(?!!)[^*]*\*+(?:[^/*][^*]*' + r'\*+)*/)+|(?:(?://[^\r\n]*)?[\r\n])+|((?:/\*![^*]*\*+(?:[^/*][^' + r'*]*\*+)*/)+)' +- ) % locals()).sub ++ ).sub + keeper = lambda m: m.groups()[0] or '' + + def subber(match): +@@ -473,27 +542,37 @@ def jsmin_for_posers(script, keep_bang_c + return ( + groups[0] or + groups[1] or +- (groups[3] and "%s%s%s%s" % ( ++ groups[3] and "%s%s" % ( + keep(keeper, groups[2]), + groups[3], +- keep(keeper, groups[4] or ''), +- groups[4] and '\n' or '', +- )) or +- (groups[7] and "%s%s%s%s%s" % ( +- keep(keeper, groups[5]), ++ ) or ++ groups[5] and "%s%s%s%s" % ( ++ keep(keeper, groups[4]), ++ groups[5], ++ keep(keeper, groups[6] or ''), + groups[6] and '\n' or '', +- groups[7], +- keep(keeper, groups[8] or ''), ++ ) or ++ groups[9] and "%s%s%s%s%s" % ( ++ keep(keeper, groups[7]), + groups[8] and '\n' or '', +- )) or +- (groups[9] and keep(keeper, groups[9] + '\n')) or +- (groups[10] and keep(keeper, groups[10]) or ' ') or +- (groups[11] and keep(keeper, groups[11]) or ' ') or +- (groups[12] and keep(keeper, groups[12]) or ' ') or +- keep(keeper, groups[13] or groups[14]) ++ groups[9], ++ keep(keeper, groups[10] or ''), ++ groups[10] and '\n' or '', ++ ) or ++ groups[11] and (keep(keeper, groups[11]) + '\n') or ++ groups[12] and (keep(keeper, groups[12]) or ' ') or ++ groups[13] and (keep(keeper, groups[13]) or ' ') or ++ groups[14] and (keep(keeper, groups[14]) or ' ') or ++ keep(keeper, groups[15] or groups[16]) + ) + +- return _re.sub(rex, subber, '\n%s\n' % script).strip() ++ is_bytes, script = _as_str(script) ++ script = _re.sub(rex, subber, '\n%s\n' % script).strip() ++ if is_bytes: ++ script = script.encode('latin-1') ++ if is_bytes == 2: ++ script = bytearray(script) ++ return script + + + if __name__ == '__main__': +diff -up chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/setup.py.12 chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/setup.py +--- chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/setup.py.12 2022-06-28 12:50:10.171324444 +0000 ++++ chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/setup.py 2021-11-05 17:03:12.000000000 +0000 +@@ -1,41 +1,264 @@ +-#!/usr/bin/python3 ++#!/usr/bin/env python + # -*- coding: ascii -*- +-# +-# Copyright 2006 - 2013 +-# Andr\xe9 Malo or his licensors, as applicable +-# +-# Licensed under the Apache License, Version 2.0 (the "License"); +-# you may not use this file except in compliance with the License. +-# You may obtain a copy of the License at +-# +-# http://www.apache.org/licenses/LICENSE-2.0 +-# +-# Unless required by applicable law or agreed to in writing, software +-# distributed under the License is distributed on an "AS IS" BASIS, +-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-# See the License for the specific language governing permissions and +-# limitations under the License. ++u""" ++:Copyright: + ++ Copyright 2011 - 2021 ++ Andr\xe9 Malo or his licensors, as applicable ++ ++:License: ++ ++ Licensed under the Apache License, Version 2.0 (the "License"); ++ you may not use this file except in compliance with the License. ++ You may obtain a copy of the License at ++ ++ http://www.apache.org/licenses/LICENSE-2.0 ++ ++ Unless required by applicable law or agreed to in writing, software ++ distributed under the License is distributed on an "AS IS" BASIS, ++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ See the License for the specific language governing permissions and ++ limitations under the License. ++ ++=========================================== ++ rJSmin - A Javascript Minifier For Python ++=========================================== ++ ++rJSmin - A Javascript Minifier For Python. ++""" ++from __future__ import print_function ++__author__ = u"Andr\xe9 Malo" ++__docformat__ = "restructuredtext en" ++ ++import os as _os ++import posixpath as _posixpath + import sys as _sys +-from _setup import run + ++# pylint: disable = no-name-in-module, import-error, raise-missing-from ++import setuptools as _setuptools ++ ++# pylint: disable = invalid-name ++ ++ ++def _doc(filename): ++ """ Read docs file """ ++ # pylint: disable = unspecified-encoding ++ args = {} if str is bytes else dict(encoding='utf-8') ++ try: ++ with open(_os.path.join('docs', filename), **args) as fp: ++ return fp.read() ++ except IOError: ++ return None ++ ++ ++def _lines(multiline): ++ """ Split multiline string into single line % empty and comments """ ++ return [line for line in ( ++ line.strip() for line in multiline.splitlines(False) ++ ) if line and not line.startswith('#')] ++ ++ ++package = dict( ++ name='rjsmin', ++ top='.', ++ pathname='.', ++ provides=_doc('PROVIDES'), ++ desc=_doc('SUMMARY').strip(), ++ longdesc=_doc('DESCRIPTION'), ++ author=__author__, ++ email='nd@perlig.de', ++ license="Apache License, Version 2.0", ++ keywords=_lines(_doc('KEYWORDS')), ++ url='http://opensource.perlig.de/rjsmin/', ++ classifiers=_lines(_doc('CLASSIFIERS') or ''), ++ ++ packages=False, ++ py_modules=['rjsmin'], ++ version_file='rjsmin.py', ++ install_requires=[], ++) ++ ++ ++class BuildFailed(Exception): ++ """ The build has failed """ ++ ++ ++from distutils.command import build_ext as _build_ext # pylint: disable = wrong-import-order ++from distutils import errors as _errors # pylint: disable = wrong-import-order ++class build_ext(_build_ext.build_ext): # pylint: disable = no-init ++ """ Improved extension building code """ ++ ++ def run(self): ++ """ Unify exception """ ++ try: ++ _build_ext.build_ext.run(self) ++ except _errors.DistutilsPlatformError: ++ raise BuildFailed() ++ ++ ++ def build_extension(self, ext): ++ """ ++ Build C extension - with extended functionality + +-def setup(args=None, _manifest=0): +- """ Main setup function """ +- from _setup.ext import Extension ++ The following features are added here: + +- if 'java' in _sys.platform.lower(): +- # no c extension for jython +- ext = None ++ - The macros ``EXT_PACKAGE`` and ``EXT_MODULE`` will be filled (or ++ unset) depending on the extensions name, but only if they are not ++ already defined. ++ ++ - "." is added to the include directories (for cext.h) ++ ++ :Parameters: ++ `ext` : `Extension` ++ The extension to build ++ ++ :Return: whatever ``distutils.command.build_ext.build_ext`` returns ++ :Rtype: any ++ """ ++ # handle name macros ++ macros = dict(ext.define_macros or ()) ++ tup = ext.name.split('.') ++ if len(tup) == 1: ++ pkg, mod = None, tup[0] ++ else: ++ pkg, mod = '.'.join(tup[:-1]), tup[-1] ++ if pkg is not None and 'EXT_PACKAGE' not in macros: ++ ext.define_macros.append(('EXT_PACKAGE', pkg)) ++ if 'EXT_MODULE' not in macros: ++ ext.define_macros.append(('EXT_MODULE', mod)) ++ if pkg is None: ++ macros = dict(ext.undef_macros or ()) ++ if 'EXT_PACKAGE' not in macros: ++ ext.undef_macros.append('EXT_PACKAGE') ++ ++ import pprint; pprint.pprint(ext.__dict__) ++ try: ++ return _build_ext.build_ext.build_extension(self, ext) ++ except (_errors.CCompilerError, _errors.DistutilsExecError, ++ _errors.DistutilsPlatformError, IOError, ValueError): ++ raise BuildFailed() ++ ++ ++class Extension(_setuptools.Extension): ++ """ improved functionality """ ++ ++ def __init__(self, *args, **kwargs): ++ """ Initialization """ ++ version = kwargs.pop('version') ++ self.depends = [] ++ if 'depends' in kwargs: ++ self.depends = kwargs['depends'] ++ _setuptools.Extension.__init__(self, *args, **kwargs) ++ self.define_macros.append(('EXT_VERSION', version)) ++ ++ # add include path ++ included = '.' ++ if included not in self.include_dirs: ++ self.include_dirs.append(included) ++ ++ # add cext.h to the dependencies ++ cext_h = _posixpath.normpath(_posixpath.join(included, 'cext.h')) ++ for item in self.depends: ++ if _posixpath.normpath(item) == cext_h: ++ break ++ else: ++ self.depends.append(cext_h) ++ ++ ++EXTENSIONS = lambda v: [Extension('_rjsmin', ["rjsmin.c"], version=v)] ++ ++ ++def do_setup(cext): ++ """ Main """ ++ # pylint: disable = too-many-branches ++ # pylint: disable = unspecified-encoding ++ ++ args = {} if str is bytes else dict(encoding='utf-8') ++ version_file = '%s/%s' % (package['pathname'], ++ package.get('version_file', '__init__.py')) ++ with open(version_file, **args) as fp: ++ for line in fp: # pylint: disable = redefined-outer-name ++ if line.startswith('__version__'): ++ version = line.split('=', 1)[1].strip() ++ if version.startswith(("'", '"')): ++ version = version[1:-1].strip() ++ break ++ else: ++ raise RuntimeError("Version not found") ++ ++ kwargs = {} ++ ++ if not cext or 'java' in _sys.platform.lower(): ++ extensions = [] + else: +- ext=[Extension('_rjsmin', sources=['rjsmin.c'])] ++ extensions = EXTENSIONS(version) ++ ++ if extensions: ++ if 'build_ext' in globals(): ++ kwargs.setdefault('cmdclass', {})['build_ext'] = build_ext ++ kwargs['ext_modules'] = extensions ++ ++ cflags = None ++ if _os.environ.get('CFLAGS') is None: ++ from distutils import ccompiler as _ccompiler ++ ++ compiler = _ccompiler.get_default_compiler() ++ try: ++ with open("debug.%s.cflags" % compiler) as fp: ++ cflags = ' '.join([ ++ line for line in (line.strip() for line in fp) ++ if line and not line.startswith('#') ++ ]).split() or None ++ except IOError: ++ pass ++ ++ if cflags: ++ gcov = 'coverage' in ' '.join(cflags) ++ for ext in extensions: ++ # pylint: disable = attribute-defined-outside-init ++ ext.extra_compile_args = \ ++ getattr(ext, 'extra_compile_args', []) + cflags ++ if gcov: ++ ext.libraries.append('gcov') ++ ++ ++ if package.get('packages', True): ++ kwargs['packages'] = [package['top']] + [ ++ '%s.%s' % (package['top'], item) ++ for item in ++ _setuptools.find_packages(package['pathname']) ++ ] ++ if package.get('py_modules'): ++ kwargs['py_modules'] = package['py_modules'] + +- return run(script_args=args, ext=ext, manifest_only=_manifest) ++ _setuptools.setup( ++ name=package['name'], ++ author=package['author'], ++ author_email=package['email'], ++ license=package['license'], ++ classifiers=package['classifiers'], ++ description=package['desc'], ++ long_description=package['longdesc'], ++ url=package['url'], ++ install_requires=package['install_requires'], ++ version=version, ++ zip_safe=False, ++ **kwargs ++ ) + + +-def manifest(): +- """ Create List of packaged files """ +- return setup((), _manifest=1) ++def setup(): ++ """ Run setup """ ++ try: ++ do_setup(True) ++ except BuildFailed: ++ env = 'SETUP_CEXT_REQUIRED' ++ if _os.environ.get(env, '') not in ('', '0'): ++ raise ++ print("C extension build failed - building python only version now. " ++ "Set '%s' environment variable to '1' to make it fail." ++ % (env,), file=_sys.stderr) ++ do_setup(False) + + + if __name__ == '__main__': diff --git a/chromium.spec b/chromium.spec index 28a3bf5..c478af4 100644 --- a/chromium.spec +++ b/chromium.spec @@ -307,6 +307,9 @@ Patch67: chromium-98.0.4758.80-remoting-cstring.patch # Apply fix_textrels hack for i686 (even without lld) Patch68: chromium-84.0.4147.125-i686-fix_textrels.patch +# Update rjsmin to 1.2.0 +Patch69: chromium-103.0.5060.53-update-rjsmin-to-1.2.0.patch + # Do not download proprietary widevine module in the background (thanks Debian) Patch79: chromium-99.0.4844.51-widevine-no-download.patch @@ -1027,6 +1030,7 @@ udev. %patch66 -p1 -b .python3-do-not-use-deprecated-mode-U %patch67 -p1 -b .remoting-cstring %patch68 -p1 -b .i686-textrels +%patch69 -p1 -b .update-rjsmin-to-1.2.0 %patch79 -p1 -b .widevine-no-download %patch80 -p1 -b .EnumTable-crash # %%patch81 -p1 -b .gcc12fix From 55d57a743cd6477a160ac6f8c4e1cd8da34bd87a Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Wed, 6 Jul 2022 17:56:52 -0400 Subject: [PATCH 108/659] fix rjsmin patch, update six to 1.16.0 --- ...mium-103.0.5060.53-python-six-1.16.0.patch | 360 ++++++++++++++++++ ...103.0.5060.53-update-rjsmin-to-1.2.0.patch | 3 +- chromium.spec | 4 + 3 files changed, 365 insertions(+), 2 deletions(-) create mode 100644 chromium-103.0.5060.53-python-six-1.16.0.patch diff --git a/chromium-103.0.5060.53-python-six-1.16.0.patch b/chromium-103.0.5060.53-python-six-1.16.0.patch new file mode 100644 index 0000000..1213e3f --- /dev/null +++ b/chromium-103.0.5060.53-python-six-1.16.0.patch @@ -0,0 +1,360 @@ +diff -up chromium-103.0.5060.53/third_party/catapult/third_party/six/six.py.116 chromium-103.0.5060.53/third_party/catapult/third_party/six/six.py +--- chromium-103.0.5060.53/third_party/catapult/third_party/six/six.py.116 2022-07-05 13:31:29.434673638 +0000 ++++ chromium-103.0.5060.53/third_party/catapult/third_party/six/six.py 2022-07-05 21:52:01.884578748 +0000 +@@ -29,7 +29,7 @@ import sys + import types + + __author__ = "Benjamin Peterson " +-__version__ = "1.15.0" ++__version__ = "1.16.0" + + + # Useful for very coarse version differentiation. +@@ -71,6 +71,11 @@ else: + MAXSIZE = int((1 << 63) - 1) + del X + ++if PY34: ++ from importlib.util import spec_from_loader ++else: ++ spec_from_loader = None ++ + + def _add_doc(func, doc): + """Add documentation to a function.""" +@@ -186,6 +191,11 @@ class _SixMetaPathImporter(object): + return self + return None + ++ def find_spec(self, fullname, path, target=None): ++ if fullname in self.known_modules: ++ return spec_from_loader(fullname, self) ++ return None ++ + def __get_module(self, fullname): + try: + return self.known_modules[fullname] +@@ -223,6 +233,12 @@ class _SixMetaPathImporter(object): + return None + get_source = get_code # same as get_code + ++ def create_module(self, spec): ++ return self.load_module(spec.name) ++ ++ def exec_module(self, module): ++ pass ++ + _importer = _SixMetaPathImporter(__name__) + + +diff -up chromium-103.0.5060.53/third_party/protobuf/third_party/six/six.py.116 chromium-103.0.5060.53/third_party/protobuf/third_party/six/six.py +--- chromium-103.0.5060.53/third_party/protobuf/third_party/six/six.py.116 2022-07-05 13:32:17.815058318 +0000 ++++ chromium-103.0.5060.53/third_party/protobuf/third_party/six/six.py 2022-07-05 22:00:28.139721738 +0000 +@@ -1,4 +1,4 @@ +-# Copyright (c) 2010-2018 Benjamin Peterson ++# Copyright (c) 2010-2020 Benjamin Peterson + # + # Permission is hereby granted, free of charge, to any person obtaining a copy + # of this software and associated documentation files (the "Software"), to deal +@@ -29,7 +29,7 @@ import sys + import types + + __author__ = "Benjamin Peterson " +-__version__ = "1.12.0" ++__version__ = "1.16.0" + + + # Useful for very coarse version differentiation. +@@ -71,6 +71,11 @@ else: + MAXSIZE = int((1 << 63) - 1) + del X + ++if PY34: ++ from importlib.util import spec_from_loader ++else: ++ spec_from_loader = None ++ + + def _add_doc(func, doc): + """Add documentation to a function.""" +@@ -186,6 +191,11 @@ class _SixMetaPathImporter(object): + return self + return None + ++ def find_spec(self, fullname, path, target=None): ++ if fullname in self.known_modules: ++ return spec_from_loader(fullname, self) ++ return None ++ + def __get_module(self, fullname): + try: + return self.known_modules[fullname] +@@ -223,6 +233,12 @@ class _SixMetaPathImporter(object): + return None + get_source = get_code # same as get_code + ++ def create_module(self, spec): ++ return self.load_module(spec.name) ++ ++ def exec_module(self, module): ++ pass ++ + _importer = _SixMetaPathImporter(__name__) + + +@@ -255,9 +271,11 @@ _moved_attributes = [ + MovedAttribute("zip_longest", "itertools", "itertools", "izip_longest", "zip_longest"), + MovedModule("builtins", "__builtin__"), + MovedModule("configparser", "ConfigParser"), ++ MovedModule("collections_abc", "collections", "collections.abc" if sys.version_info >= (3, 3) else "collections"), + MovedModule("copyreg", "copy_reg"), + MovedModule("dbm_gnu", "gdbm", "dbm.gnu"), +- MovedModule("_dummy_thread", "dummy_thread", "_dummy_thread"), ++ MovedModule("dbm_ndbm", "dbm", "dbm.ndbm"), ++ MovedModule("_dummy_thread", "dummy_thread", "_dummy_thread" if sys.version_info < (3, 9) else "_thread"), + MovedModule("http_cookiejar", "cookielib", "http.cookiejar"), + MovedModule("http_cookies", "Cookie", "http.cookies"), + MovedModule("html_entities", "htmlentitydefs", "html.entities"), +@@ -637,13 +655,16 @@ if PY3: + import io + StringIO = io.StringIO + BytesIO = io.BytesIO ++ del io + _assertCountEqual = "assertCountEqual" + if sys.version_info[1] <= 1: + _assertRaisesRegex = "assertRaisesRegexp" + _assertRegex = "assertRegexpMatches" ++ _assertNotRegex = "assertNotRegexpMatches" + else: + _assertRaisesRegex = "assertRaisesRegex" + _assertRegex = "assertRegex" ++ _assertNotRegex = "assertNotRegex" + else: + def b(s): + return s +@@ -665,6 +686,7 @@ else: + _assertCountEqual = "assertItemsEqual" + _assertRaisesRegex = "assertRaisesRegexp" + _assertRegex = "assertRegexpMatches" ++ _assertNotRegex = "assertNotRegexpMatches" + _add_doc(b, """Byte literal""") + _add_doc(u, """Text literal""") + +@@ -681,6 +703,10 @@ def assertRegex(self, *args, **kwargs): + return getattr(self, _assertRegex)(*args, **kwargs) + + ++def assertNotRegex(self, *args, **kwargs): ++ return getattr(self, _assertNotRegex)(*args, **kwargs) ++ ++ + if PY3: + exec_ = getattr(moves.builtins, "exec") + +@@ -716,16 +742,7 @@ else: + """) + + +-if sys.version_info[:2] == (3, 2): +- exec_("""def raise_from(value, from_value): +- try: +- if from_value is None: +- raise value +- raise value from from_value +- finally: +- value = None +-""") +-elif sys.version_info[:2] > (3, 2): ++if sys.version_info[:2] > (3,): + exec_("""def raise_from(value, from_value): + try: + raise value from from_value +@@ -805,13 +822,33 @@ if sys.version_info[:2] < (3, 3): + _add_doc(reraise, """Reraise an exception.""") + + if sys.version_info[0:2] < (3, 4): ++ # This does exactly the same what the :func:`py3:functools.update_wrapper` ++ # function does on Python versions after 3.2. It sets the ``__wrapped__`` ++ # attribute on ``wrapper`` object and it doesn't raise an error if any of ++ # the attributes mentioned in ``assigned`` and ``updated`` are missing on ++ # ``wrapped`` object. ++ def _update_wrapper(wrapper, wrapped, ++ assigned=functools.WRAPPER_ASSIGNMENTS, ++ updated=functools.WRAPPER_UPDATES): ++ for attr in assigned: ++ try: ++ value = getattr(wrapped, attr) ++ except AttributeError: ++ continue ++ else: ++ setattr(wrapper, attr, value) ++ for attr in updated: ++ getattr(wrapper, attr).update(getattr(wrapped, attr, {})) ++ wrapper.__wrapped__ = wrapped ++ return wrapper ++ _update_wrapper.__doc__ = functools.update_wrapper.__doc__ ++ + def wraps(wrapped, assigned=functools.WRAPPER_ASSIGNMENTS, + updated=functools.WRAPPER_UPDATES): +- def wrapper(f): +- f = functools.wraps(wrapped, assigned, updated)(f) +- f.__wrapped__ = wrapped +- return f +- return wrapper ++ return functools.partial(_update_wrapper, wrapped=wrapped, ++ assigned=assigned, updated=updated) ++ wraps.__doc__ = functools.wraps.__doc__ ++ + else: + wraps = functools.wraps + +@@ -824,7 +861,15 @@ def with_metaclass(meta, *bases): + class metaclass(type): + + def __new__(cls, name, this_bases, d): +- return meta(name, bases, d) ++ if sys.version_info[:2] >= (3, 7): ++ # This version introduced PEP 560 that requires a bit ++ # of extra care (we mimic what is done by __build_class__). ++ resolved_bases = types.resolve_bases(bases) ++ if resolved_bases is not bases: ++ d['__orig_bases__'] = bases ++ else: ++ resolved_bases = bases ++ return meta(name, resolved_bases, d) + + @classmethod + def __prepare__(cls, name, this_bases): +@@ -861,12 +906,11 @@ def ensure_binary(s, encoding='utf-8', e + - `str` -> encoded to `bytes` + - `bytes` -> `bytes` + """ ++ if isinstance(s, binary_type): ++ return s + if isinstance(s, text_type): + return s.encode(encoding, errors) +- elif isinstance(s, binary_type): +- return s +- else: +- raise TypeError("not expecting type '%s'" % type(s)) ++ raise TypeError("not expecting type '%s'" % type(s)) + + + def ensure_str(s, encoding='utf-8', errors='strict'): +@@ -880,12 +924,15 @@ def ensure_str(s, encoding='utf-8', erro + - `str` -> `str` + - `bytes` -> decoded to `str` + """ +- if not isinstance(s, (text_type, binary_type)): +- raise TypeError("not expecting type '%s'" % type(s)) ++ # Optimization: Fast return for the common case. ++ if type(s) is str: ++ return s + if PY2 and isinstance(s, text_type): +- s = s.encode(encoding, errors) ++ return s.encode(encoding, errors) + elif PY3 and isinstance(s, binary_type): +- s = s.decode(encoding, errors) ++ return s.decode(encoding, errors) ++ elif not isinstance(s, (text_type, binary_type)): ++ raise TypeError("not expecting type '%s'" % type(s)) + return s + + +@@ -908,10 +955,9 @@ def ensure_text(s, encoding='utf-8', err + raise TypeError("not expecting type '%s'" % type(s)) + + +- + def python_2_unicode_compatible(klass): + """ +- A decorator that defines __unicode__ and __str__ methods under Python 2. ++ A class decorator that defines __unicode__ and __str__ methods under Python 2. + Under Python 3 it does nothing. + + To support Python 2 and 3 with a single code base, define a __str__ method +diff -up chromium-103.0.5060.53/third_party/six/src/six.py.116 chromium-103.0.5060.53/third_party/six/src/six.py +--- chromium-103.0.5060.53/third_party/six/src/six.py.116 2022-07-05 13:32:28.916687658 +0000 ++++ chromium-103.0.5060.53/third_party/six/src/six.py 2022-07-05 21:59:42.561240407 +0000 +@@ -29,7 +29,7 @@ import sys + import types + + __author__ = "Benjamin Peterson " +-__version__ = "1.14.0" ++__version__ = "1.16.0" + + + # Useful for very coarse version differentiation. +@@ -71,6 +71,11 @@ else: + MAXSIZE = int((1 << 63) - 1) + del X + ++if PY34: ++ from importlib.util import spec_from_loader ++else: ++ spec_from_loader = None ++ + + def _add_doc(func, doc): + """Add documentation to a function.""" +@@ -186,6 +191,11 @@ class _SixMetaPathImporter(object): + return self + return None + ++ def find_spec(self, fullname, path, target=None): ++ if fullname in self.known_modules: ++ return spec_from_loader(fullname, self) ++ return None ++ + def __get_module(self, fullname): + try: + return self.known_modules[fullname] +@@ -223,6 +233,12 @@ class _SixMetaPathImporter(object): + return None + get_source = get_code # same as get_code + ++ def create_module(self, spec): ++ return self.load_module(spec.name) ++ ++ def exec_module(self, module): ++ pass ++ + _importer = _SixMetaPathImporter(__name__) + + +@@ -890,12 +906,11 @@ def ensure_binary(s, encoding='utf-8', e + - `str` -> encoded to `bytes` + - `bytes` -> `bytes` + """ ++ if isinstance(s, binary_type): ++ return s + if isinstance(s, text_type): + return s.encode(encoding, errors) +- elif isinstance(s, binary_type): +- return s +- else: +- raise TypeError("not expecting type '%s'" % type(s)) ++ raise TypeError("not expecting type '%s'" % type(s)) + + + def ensure_str(s, encoding='utf-8', errors='strict'): +@@ -909,12 +924,15 @@ def ensure_str(s, encoding='utf-8', erro + - `str` -> `str` + - `bytes` -> decoded to `str` + """ +- if not isinstance(s, (text_type, binary_type)): +- raise TypeError("not expecting type '%s'" % type(s)) ++ # Optimization: Fast return for the common case. ++ if type(s) is str: ++ return s + if PY2 and isinstance(s, text_type): +- s = s.encode(encoding, errors) ++ return s.encode(encoding, errors) + elif PY3 and isinstance(s, binary_type): +- s = s.decode(encoding, errors) ++ return s.decode(encoding, errors) ++ elif not isinstance(s, (text_type, binary_type)): ++ raise TypeError("not expecting type '%s'" % type(s)) + return s + + diff --git a/chromium-103.0.5060.53-update-rjsmin-to-1.2.0.patch b/chromium-103.0.5060.53-update-rjsmin-to-1.2.0.patch index 9ccd1a0..29a5d9c 100644 --- a/chromium-103.0.5060.53-update-rjsmin-to-1.2.0.patch +++ b/chromium-103.0.5060.53-update-rjsmin-to-1.2.0.patch @@ -1407,8 +1407,7 @@ diff -up chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_p --- chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/setup.py.12 2022-06-28 12:50:10.171324444 +0000 +++ chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/setup.py 2021-11-05 17:03:12.000000000 +0000 @@ -1,41 +1,264 @@ --#!/usr/bin/python3 -+#!/usr/bin/env python + #!/usr/bin/env python # -*- coding: ascii -*- -# -# Copyright 2006 - 2013 diff --git a/chromium.spec b/chromium.spec index c478af4..b537a91 100644 --- a/chromium.spec +++ b/chromium.spec @@ -310,6 +310,9 @@ Patch68: chromium-84.0.4147.125-i686-fix_textrels.patch # Update rjsmin to 1.2.0 Patch69: chromium-103.0.5060.53-update-rjsmin-to-1.2.0.patch +# Update six to 1.16.0 +Patch70: chromium-103.0.5060.53-python-six-1.16.0.patch + # Do not download proprietary widevine module in the background (thanks Debian) Patch79: chromium-99.0.4844.51-widevine-no-download.patch @@ -1031,6 +1034,7 @@ udev. %patch67 -p1 -b .remoting-cstring %patch68 -p1 -b .i686-textrels %patch69 -p1 -b .update-rjsmin-to-1.2.0 +%patch70 -p1 -b .update-six-to-1.16.0 %patch79 -p1 -b .widevine-no-download %patch80 -p1 -b .EnumTable-crash # %%patch81 -p1 -b .gcc12fix From d79b33335e26be206566e50a6124a4f497c5d296 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Fri, 15 Jul 2022 14:39:17 -0400 Subject: [PATCH 109/659] 103.0.5060.114 --- chromium.spec | 5 ++++- sources | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/chromium.spec b/chromium.spec index b537a91..0ea9e4f 100644 --- a/chromium.spec +++ b/chromium.spec @@ -227,7 +227,7 @@ Name: chromium%{chromium_channel}%{nsuffix} %else Name: chromium%{chromium_channel} %endif -Version: %{majorversion}.0.5060.53 +Version: %{majorversion}.0.5060.114 Release: 1%{?dist} %if %{?freeworld} %if %{?shared} @@ -2185,6 +2185,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Wed Jul 13 2022 Tom Callaway - 103.0.5060.114-1 +- update to 103.0.5060.114 + * Wed Jun 22 2022 Tom Callaway - 103.0.5060.53-1 - update to 103.0.5060.53 diff --git a/sources b/sources index 0cd6d37..1affc18 100644 --- a/sources +++ b/sources @@ -21,4 +21,4 @@ SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1d SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a SHA512 (node-v12.22.6-linux-arm64.tar.xz) = 87ce5eb954deb1d0debe6fa02b28a3cc675e12fca1e51d44b123ab294aa39ce0c6b8ac9eae1e7a6e32673ea2c2d480651d9ba7eea73012f0529503eebe9eb34d SHA512 (node-v12.22.6-linux-x64.tar.xz) = e1b55c32343cb2ccc40d888c705414bebf9c46b02083d13731df79b1e79521b7277761f6bcca041e40e3a2e47c67bb8e7848aa2b919a9de5c2ebf62c4a9c7176 -SHA512 (chromium-103.0.5060.53-clean.tar.xz) = 2fe8695a291e483053e014a507d695e1efa547a276d170e9e082a539d47364a8cb78892c3e0ed26fcf4b1418ff43a56c7d582997215c633e71f3620dfb474db9 +SHA512 (chromium-103.0.5060.114-clean.tar.xz) = 9173f2110c6442043b057bfdb629874a1dba92a392d368dc23b66d4926567d7c71a341150499768e3536bf154d64cfc54d99f37d2cc232e38bfa1498cc06a32c From f395fe077e26af2e2e305d337bfec48be9773682 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 20 Jul 2022 22:54:34 +0000 Subject: [PATCH 110/659] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- chromium.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chromium.spec b/chromium.spec index 0ea9e4f..11ca13d 100644 --- a/chromium.spec +++ b/chromium.spec @@ -228,7 +228,7 @@ Name: chromium%{chromium_channel}%{nsuffix} Name: chromium%{chromium_channel} %endif Version: %{majorversion}.0.5060.114 -Release: 1%{?dist} +Release: 2%{?dist} %if %{?freeworld} %if %{?shared} # chromium-libs-media-freeworld @@ -2185,6 +2185,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Wed Jul 20 2022 Fedora Release Engineering - 103.0.5060.114-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Wed Jul 13 2022 Tom Callaway - 103.0.5060.114-1 - update to 103.0.5060.114 From 1e2f91b9238ecc26a85a9ee2fa375929b238bcbe Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Fri, 19 Aug 2022 09:57:47 -0400 Subject: [PATCH 111/659] 104.0.5112.101 --- chromium-104-ContentRendererClient-type.patch | 28 +++++++ ...01-enable-hardware-accelerated-mjpeg.patch | 36 ++++----- ...0.5112.101-system-minizip-header-fix.patch | 76 +++++++++++++++++++ chromium.spec | 27 ++++--- clean_ffmpeg.sh | 3 + sources | 2 +- 6 files changed, 143 insertions(+), 29 deletions(-) create mode 100644 chromium-104-ContentRendererClient-type.patch rename chromium-102.0.5005.61-enable-hardware-accelerated-mjpeg.patch => chromium-104.0.5112.101-enable-hardware-accelerated-mjpeg.patch (51%) create mode 100644 chromium-104.0.5112.101-system-minizip-header-fix.patch diff --git a/chromium-104-ContentRendererClient-type.patch b/chromium-104-ContentRendererClient-type.patch new file mode 100644 index 0000000..a6d5a86 --- /dev/null +++ b/chromium-104-ContentRendererClient-type.patch @@ -0,0 +1,28 @@ +From a61a70605f9efc81fead5bf6984bc5ce39f1569d Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Fri, 27 May 2022 18:11:52 +0000 +Subject: [PATCH] libstdc++: fix incomplete type of + content::ContentRendererClient + +Destructor of std::unique_ptr in libstdc++ uses sizeof() which +requires full definition of media::AudioEncoder for return type of +cast_streaming::ResourceProvider. +--- + content/public/renderer/content_renderer_client.cc | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/content/public/renderer/content_renderer_client.cc b/content/public/renderer/content_renderer_client.cc +index 63456aa..637a2a7 100644 +--- a/content/public/renderer/content_renderer_client.cc ++++ b/content/public/renderer/content_renderer_client.cc +@@ -6,6 +6,7 @@ + + #include "base/command_line.h" + #include "build/build_config.h" ++#include "components/cast_streaming/renderer/public/resource_provider.h" + #include "content/public/common/content_switches.h" + #include "media/base/demuxer.h" + #include "media/base/renderer_factory.h" +-- +2.35.1 + diff --git a/chromium-102.0.5005.61-enable-hardware-accelerated-mjpeg.patch b/chromium-104.0.5112.101-enable-hardware-accelerated-mjpeg.patch similarity index 51% rename from chromium-102.0.5005.61-enable-hardware-accelerated-mjpeg.patch rename to chromium-104.0.5112.101-enable-hardware-accelerated-mjpeg.patch index 6873272..06116e4 100644 --- a/chromium-102.0.5005.61-enable-hardware-accelerated-mjpeg.patch +++ b/chromium-104.0.5112.101-enable-hardware-accelerated-mjpeg.patch @@ -1,7 +1,7 @@ -diff -up chromium-102.0.5005.61/chrome/browser/about_flags.cc.accel-mjpeg chromium-102.0.5005.61/chrome/browser/about_flags.cc ---- chromium-102.0.5005.61/chrome/browser/about_flags.cc.accel-mjpeg 2022-05-19 02:16:44.000000000 +0000 -+++ chromium-102.0.5005.61/chrome/browser/about_flags.cc 2022-06-03 20:09:42.298053196 +0000 -@@ -4308,12 +4308,12 @@ const FeatureEntry kFeatureEntries[] = { +diff -up chromium-104.0.5112.101/chrome/browser/about_flags.cc.accel-mjpeg chromium-104.0.5112.101/chrome/browser/about_flags.cc +--- chromium-104.0.5112.101/chrome/browser/about_flags.cc.accel-mjpeg 2022-08-16 23:29:08.000000000 +0000 ++++ chromium-104.0.5112.101/chrome/browser/about_flags.cc 2022-08-18 14:21:36.762266571 +0000 +@@ -4485,12 +4485,12 @@ const FeatureEntry kFeatureEntries[] = { flag_descriptions::kWebXrForceRuntimeDescription, kOsDesktop, MULTI_VALUE_TYPE(kWebXrForceRuntimeChoices)}, #endif // ENABLE_VR @@ -17,10 +17,10 @@ diff -up chromium-102.0.5005.61/chrome/browser/about_flags.cc.accel-mjpeg chromi {"system-keyboard-lock", flag_descriptions::kSystemKeyboardLockName, flag_descriptions::kSystemKeyboardLockDescription, kOsDesktop, FEATURE_VALUE_TYPE(features::kSystemKeyboardLock)}, -diff -up chromium-102.0.5005.61/chrome/browser/flag_descriptions.cc.accel-mjpeg chromium-102.0.5005.61/chrome/browser/flag_descriptions.cc ---- chromium-102.0.5005.61/chrome/browser/flag_descriptions.cc.accel-mjpeg 2022-06-03 17:55:53.493268667 +0000 -+++ chromium-102.0.5005.61/chrome/browser/flag_descriptions.cc 2022-06-03 20:22:41.162906775 +0000 -@@ -4029,7 +4029,7 @@ const char kUseAngleGL[] = "OpenGL"; +diff -up chromium-104.0.5112.101/chrome/browser/flag_descriptions.cc.accel-mjpeg chromium-104.0.5112.101/chrome/browser/flag_descriptions.cc +--- chromium-104.0.5112.101/chrome/browser/flag_descriptions.cc.accel-mjpeg 2022-08-16 23:29:09.000000000 +0000 ++++ chromium-104.0.5112.101/chrome/browser/flag_descriptions.cc 2022-08-18 14:25:23.609572649 +0000 +@@ -4170,7 +4170,7 @@ const char kUseAngleGL[] = "OpenGL"; // ChromeOS ------------------------------------------------------------------- @@ -29,7 +29,7 @@ diff -up chromium-102.0.5005.61/chrome/browser/flag_descriptions.cc.accel-mjpeg const char kAcceleratedMjpegDecodeName[] = "Hardware-accelerated mjpeg decode for captured frame"; -@@ -4037,6 +4037,10 @@ const char kAcceleratedMjpegDecodeDescri +@@ -4178,6 +4178,10 @@ const char kAcceleratedMjpegDecodeDescri "Enable hardware-accelerated mjpeg decode for captured frame where " "available."; @@ -37,13 +37,13 @@ diff -up chromium-102.0.5005.61/chrome/browser/flag_descriptions.cc.accel-mjpeg + +#if BUILDFLAG(IS_CHROMEOS_ASH) + - const char kAllowDisableTouchpadHapticFeedbackName[] = - "Allow disabling touchpad haptic feedback"; - const char kAllowDisableTouchpadHapticFeedbackDescription[] = -diff -up chromium-102.0.5005.61/chrome/browser/flag_descriptions.h.accel-mjpeg chromium-102.0.5005.61/chrome/browser/flag_descriptions.h ---- chromium-102.0.5005.61/chrome/browser/flag_descriptions.h.accel-mjpeg 2022-06-03 17:55:53.494268633 +0000 -+++ chromium-102.0.5005.61/chrome/browser/flag_descriptions.h 2022-06-03 20:23:50.514578649 +0000 -@@ -2303,11 +2303,15 @@ extern const char kUseAngleGL[]; + const char kAdaptiveChargingForTestingName[] = + "Show adaptive charging notifications for testing"; + const char kAdaptiveChargingForTestingDescription[] = +diff -up chromium-104.0.5112.101/chrome/browser/flag_descriptions.h.accel-mjpeg chromium-104.0.5112.101/chrome/browser/flag_descriptions.h +--- chromium-104.0.5112.101/chrome/browser/flag_descriptions.h.accel-mjpeg 2022-08-18 14:21:36.765266469 +0000 ++++ chromium-104.0.5112.101/chrome/browser/flag_descriptions.h 2022-08-18 14:26:10.469983301 +0000 +@@ -2390,11 +2390,15 @@ extern const char kUseAngleGL[]; // ChromeOS ------------------------------------------------------------------- @@ -57,6 +57,6 @@ diff -up chromium-102.0.5005.61/chrome/browser/flag_descriptions.h.accel-mjpeg c + +#if BUILDFLAG(IS_CHROMEOS_ASH) + - extern const char kAllowDisableTouchpadHapticFeedbackName[]; - extern const char kAllowDisableTouchpadHapticFeedbackDescription[]; + extern const char kAdaptiveChargingName[]; + extern const char kAdaptiveChargingDescription[]; diff --git a/chromium-104.0.5112.101-system-minizip-header-fix.patch b/chromium-104.0.5112.101-system-minizip-header-fix.patch new file mode 100644 index 0000000..acda436 --- /dev/null +++ b/chromium-104.0.5112.101-system-minizip-header-fix.patch @@ -0,0 +1,76 @@ +diff -up chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc.system-minizip chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc +--- chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc.system-minizip 2022-08-18 23:16:03.451728329 +0000 ++++ chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc 2022-08-18 23:16:23.966049114 +0000 +@@ -21,8 +21,8 @@ limitations under the License. + #include "absl/status/status.h" // from @com_google_absl + #include "absl/strings/str_format.h" // from @com_google_absl + #include "absl/strings/string_view.h" // from @com_google_absl +-#include "contrib/minizip/ioapi.h" +-#include "contrib/minizip/unzip.h" ++#include ++#include + #include "flatbuffers/flatbuffers.h" // from @flatbuffers + #include "tensorflow/lite/schema/schema_generated.h" + #include "tensorflow_lite_support/cc/common.h" +diff -up chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc.system-minizip chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc +--- chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc.system-minizip 2022-08-18 23:16:52.463105585 +0000 ++++ chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc 2022-08-18 23:17:12.849430606 +0000 +@@ -19,8 +19,8 @@ limitations under the License. + #include + #include + +-#include "contrib/minizip/ioapi.h" +-#include "contrib/minizip/zip.h" ++#include ++#include + #include "flatbuffers/flatbuffers.h" // from @flatbuffers + #include "tensorflow/lite/schema/schema_generated.h" + #include "tensorflow_lite_support/cc/common.h" +diff -up chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc.system-minizip chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc +--- chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc.system-minizip 2022-08-18 23:18:14.697382850 +0000 ++++ chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc 2022-08-18 23:18:27.148970583 +0000 +@@ -19,7 +19,7 @@ limitations under the License. + #include + + #include "absl/strings/string_view.h" // from @com_google_absl +-#include "contrib/minizip/ioapi.h" ++#include + + namespace tflite { + namespace metadata { +diff -up chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h.system-minizip chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h +--- chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h.system-minizip 2022-08-18 20:14:28.116854693 +0000 ++++ chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h 2022-08-18 20:14:28.115854726 +0000 +@@ -19,7 +19,7 @@ limitations under the License. + #include + + #include "absl/strings/string_view.h" // from @com_google_absl +-#include "contrib/minizip/ioapi.h" ++#include + + namespace tflite { + namespace metadata { +diff -up chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc.system-minizip chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc +--- chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc.system-minizip 2022-08-18 23:19:14.807392634 +0000 ++++ chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc 2022-08-18 23:19:31.177850617 +0000 +@@ -19,7 +19,7 @@ limitations under the License. + #include + + #include "absl/strings/string_view.h" // from @com_google_absl +-#include "contrib/minizip/ioapi.h" ++#include + + namespace tflite { + namespace metadata { +diff -up chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h.system-minizip chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h +--- chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h.system-minizip 2022-08-18 20:14:28.116854693 +0000 ++++ chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h 2022-08-18 20:14:28.116854693 +0000 +@@ -19,7 +19,7 @@ limitations under the License. + #include + + #include "absl/strings/string_view.h" // from @com_google_absl +-#include "contrib/minizip/ioapi.h" ++#include + + namespace tflite { + namespace metadata { diff --git a/chromium.spec b/chromium.spec index 11ca13d..b0d4f7c 100644 --- a/chromium.spec +++ b/chromium.spec @@ -220,15 +220,15 @@ BuildRequires: libicu-devel >= 5.4 %global chromoting_client_id %nil %endif -%global majorversion 103 +%global majorversion 104 %if %{freeworld} Name: chromium%{chromium_channel}%{nsuffix} %else Name: chromium%{chromium_channel} %endif -Version: %{majorversion}.0.5060.114 -Release: 2%{?dist} +Version: %{majorversion}.0.5112.101 +Release: 1%{?dist} %if %{?freeworld} %if %{?shared} # chromium-libs-media-freeworld @@ -286,10 +286,11 @@ Patch57: chromium-96.0.4664.45-missing-cstring.patch Patch58: chromium-53-ffmpeg-no-deprecation-errors.patch # https://github.com/stha09/chromium-patches/blob/master/chromium-103-VirtualCursor-std-layout.patch Patch59: chromium-103-VirtualCursor-std-layout.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-103-SubstringSetMatcher-packed.patch -Patch60: chromium-103-SubstringSetMatcher-packed.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-103-FrameLoadRequest-type.patch -Patch61: chromium-103-FrameLoadRequest-type.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-104-ContentRendererClient-type.patch +Patch60: chromium-104-ContentRendererClient-type.patch + +# Fix headers to look for system paths when we are using system minizip +Patch61: chromium-104.0.5112.101-system-minizip-header-fix.patch # https://github.com/v8/v8/commit/2ed27bba6a881a152887f3ab1008e989fce617e3 Patch63: chromium-102.0.5005.115-v8-aarch64-gcc-cfi-fix.patch @@ -380,7 +381,7 @@ Patch111: chromium-99.0.4844.51-el7-extra-operator==.patch # VAAPI # Upstream turned VAAPI on in Linux in 86 -Patch202: chromium-102.0.5005.61-enable-hardware-accelerated-mjpeg.patch +Patch202: chromium-104.0.5112.101-enable-hardware-accelerated-mjpeg.patch Patch203: chromium-86.0.4240.75-vaapi-i686-fpermissive.patch Patch205: chromium-86.0.4240.75-fix-vaapi-on-intel.patch @@ -1024,8 +1025,11 @@ udev. %patch57 -p1 -b .missing-cstring %patch58 -p1 -b .ffmpeg-deprecations %patch59 -p1 -b .VirtualCursor-std-layout -%patch60 -p1 -b .SubstringSetMatcher-packed -%patch61 -p1 -b .FrameLoadRequest-type +%patch60 -p1 -b .ContentRendererType-client + +%if ! 0%{?bundleminizip} +%patch61 -p1 -b .system-minizip +%endif %patch63 -p1 -b .gcc-cfi-fix %patch64 -p1 -b .aarch64-cxxflags-addition @@ -2185,6 +2189,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Thu Aug 18 2022 Tom Callaway - 104.0.5112.101-1 +- update to 104.0.5112.101 + * Wed Jul 20 2022 Fedora Release Engineering - 103.0.5060.114-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild diff --git a/clean_ffmpeg.sh b/clean_ffmpeg.sh index 614c0fe..d998983 100755 --- a/clean_ffmpeg.sh +++ b/clean_ffmpeg.sh @@ -68,6 +68,7 @@ header_files=" libavcodec/x86/inline_asm.h \ libavcodec/aac_ac3_parser.h \ libavcodec/aac_defines.h \ libavcodec/ac3.h \ + libavcodec/ac3defs.h \ libavcodec/ac3tab.h \ libavcodec/adts_header.h \ libavcodec/avcodec.h \ @@ -261,6 +262,7 @@ manual_files=" libavcodec/aarch64/fft_neon.S \ libavformat/options.c \ libavformat/pcm.c \ libavformat/utils.c \ + libavformat/version.c \ libavutil/aarch64/asm.S \ libavutil/aarch64/bswap.h \ libavutil/aarch64/cpu.c \ @@ -273,6 +275,7 @@ manual_files=" libavcodec/aarch64/fft_neon.S \ libavutil/tx_float.c \ libavutil/tx_template.c \ libavutil/utils.c \ + libavutil/version.c \ libavutil/x86/cpu.c \ libavutil/x86/float_dsp_init.c \ libavutil/x86/x86inc.asm \ diff --git a/sources b/sources index 1affc18..0a9637d 100644 --- a/sources +++ b/sources @@ -21,4 +21,4 @@ SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1d SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a SHA512 (node-v12.22.6-linux-arm64.tar.xz) = 87ce5eb954deb1d0debe6fa02b28a3cc675e12fca1e51d44b123ab294aa39ce0c6b8ac9eae1e7a6e32673ea2c2d480651d9ba7eea73012f0529503eebe9eb34d SHA512 (node-v12.22.6-linux-x64.tar.xz) = e1b55c32343cb2ccc40d888c705414bebf9c46b02083d13731df79b1e79521b7277761f6bcca041e40e3a2e47c67bb8e7848aa2b919a9de5c2ebf62c4a9c7176 -SHA512 (chromium-103.0.5060.114-clean.tar.xz) = 9173f2110c6442043b057bfdb629874a1dba92a392d368dc23b66d4926567d7c71a341150499768e3536bf154d64cfc54d99f37d2cc232e38bfa1498cc06a32c +SHA512 (chromium-104.0.5112.101-clean.tar.xz) = 280c88c3b8a14acae8187835ffddfad3f76f6b53fd9a33e39a7c980f29d898250647f922242a41cbb9fdac7c54b2f4e181a9520adc9b7f1b40aac4e0b57be9a0 From af04eed16c2476ff5014de46ba57de56927904d4 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Fri, 19 Aug 2022 13:47:51 -0400 Subject: [PATCH 112/659] be explicit about the need for importlib-metadata --- chromium.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/chromium.spec b/chromium.spec index b0d4f7c..53e0014 100644 --- a/chromium.spec +++ b/chromium.spec @@ -604,6 +604,7 @@ BuildRequires: python-html5lib BuildRequires: python-markupsafe BuildRequires: python-ply %endif +BuildRequires: python3-importlib-metadata BuildRequires: python3-simplejson %endif %else From df09afc1142d4b8cdc6fc5d651571cd3347e19bc Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Thu, 25 Aug 2022 09:37:51 -0400 Subject: [PATCH 113/659] Fix v8 issue where GCC on arm64 fails to compile extract_first_nonzero_index because of the signedness type mismatch in the NEON intrinsics --- ...592cf8867f0cd6d8d41b43392fb52d359649.patch | 77 +++++++++++++++++++ chromium.spec | 7 ++ 2 files changed, 84 insertions(+) create mode 100644 0fc6592cf8867f0cd6d8d41b43392fb52d359649.patch diff --git a/0fc6592cf8867f0cd6d8d41b43392fb52d359649.patch b/0fc6592cf8867f0cd6d8d41b43392fb52d359649.patch new file mode 100644 index 0000000..7152988 --- /dev/null +++ b/0fc6592cf8867f0cd6d8d41b43392fb52d359649.patch @@ -0,0 +1,77 @@ +From 0fc6592cf8867f0cd6d8d41b43392fb52d359649 Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz +Date: Tue, 7 Jun 2022 15:44:35 +0200 +Subject: [PATCH] GCC: fix compilation of NEON64 extract_first_nonzero_index +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +GCC fails to compile extract_first_nonzero_index because of the +signedness type mismatch in the NEON intrinsics. + +Bug: chromium:819294 +Change-Id: I9b73e5fa1d5fbf161740ab1b5d77f5c494369dfa +Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3693709 +Reviewed-by: Toon Verwaest +Commit-Queue: José Dapena Paz +Cr-Commit-Position: refs/heads/main@{#81063} +--- + v8/src/objects/simd.cc | 27 ++++++++++++--------------- + 1 file changed, 12 insertions(+), 15 deletions(-) + +diff --git a/v8/src/objects/simd.cc b/v8/rc/objects/simd.cc +index d3cedfe3302..0a73b9c686d 100644 +--- a/v8/src/objects/simd.cc ++++ b/v8/src/objects/simd.cc +@@ -95,24 +95,21 @@ inline int extract_first_nonzero_index(T v) { + } + + template <> +-inline int extract_first_nonzero_index(int32x4_t v) { +- int32x4_t mask = {4, 3, 2, 1}; ++inline int extract_first_nonzero_index(uint32x4_t v) { ++ uint32x4_t mask = {4, 3, 2, 1}; + mask = vandq_u32(mask, v); + return 4 - vmaxvq_u32(mask); + } + + template <> +-inline int extract_first_nonzero_index(int64x2_t v) { +- int32x4_t mask = {2, 0, 1, 0}; // Could also be {2,2,1,1} or {0,2,0,1} +- mask = vandq_u32(mask, vreinterpretq_s32_s64(v)); ++inline int extract_first_nonzero_index(uint64x2_t v) { ++ uint32x4_t mask = {2, 0, 1, 0}; // Could also be {2,2,1,1} or {0,2,0,1} ++ mask = vandq_u32(mask, vreinterpretq_u32_u64(v)); + return 2 - vmaxvq_u32(mask); + } + +-template <> +-inline int extract_first_nonzero_index(float64x2_t v) { +- int32x4_t mask = {2, 0, 1, 0}; // Could also be {2,2,1,1} or {0,2,0,1} +- mask = vandq_u32(mask, vreinterpretq_s32_f64(v)); +- return 2 - vmaxvq_u32(mask); ++inline int32_t reinterpret_vmaxvq_u64(uint64x2_t v) { ++ return vmaxvq_u32(vreinterpretq_u32_u64(v)); + } + #endif + +@@ -204,14 +201,14 @@ inline uintptr_t fast_search_noavx(T* array, uintptr_t array_len, + } + #elif defined(NEON64) + if constexpr (std::is_same::value) { +- VECTORIZED_LOOP_Neon(int32x4_t, int32x4_t, vdupq_n_u32, vceqq_u32, ++ VECTORIZED_LOOP_Neon(uint32x4_t, uint32x4_t, vdupq_n_u32, vceqq_u32, + vmaxvq_u32) + } else if constexpr (std::is_same::value) { +- VECTORIZED_LOOP_Neon(int64x2_t, int64x2_t, vdupq_n_u64, vceqq_u64, +- vmaxvq_u32) ++ VECTORIZED_LOOP_Neon(uint64x2_t, uint64x2_t, vdupq_n_u64, vceqq_u64, ++ reinterpret_vmaxvq_u64) + } else if constexpr (std::is_same::value) { +- VECTORIZED_LOOP_Neon(float64x2_t, float64x2_t, vdupq_n_f64, vceqq_f64, +- vmaxvq_f64) ++ VECTORIZED_LOOP_Neon(float64x2_t, uint64x2_t, vdupq_n_f64, vceqq_f64, ++ reinterpret_vmaxvq_u64) + } + #else + UNREACHABLE(); diff --git a/chromium.spec b/chromium.spec index 53e0014..e4afb4c 100644 --- a/chromium.spec +++ b/chromium.spec @@ -292,6 +292,11 @@ Patch60: chromium-104-ContentRendererClient-type.patch # Fix headers to look for system paths when we are using system minizip Patch61: chromium-104.0.5112.101-system-minizip-header-fix.patch +# Fix v8 issue where GCC on arm64 fails to compile extract_first_nonzero_index because of the +# signedness type mismatch in the NEON intrinsics +# https://github.com/v8/v8/commit/0fc6592cf8867f0cd6d8d41b43392fb52d359649.patch +Patch62: 0fc6592cf8867f0cd6d8d41b43392fb52d359649.patch + # https://github.com/v8/v8/commit/2ed27bba6a881a152887f3ab1008e989fce617e3 Patch63: chromium-102.0.5005.115-v8-aarch64-gcc-cfi-fix.patch # Extra CXXFLAGS for aarch64 @@ -1032,6 +1037,8 @@ udev. %patch61 -p1 -b .system-minizip %endif +%patch62 -p1 -b .arm-neon-fix + %patch63 -p1 -b .gcc-cfi-fix %patch64 -p1 -b .aarch64-cxxflags-addition %patch65 -p1 -b .java-only-allowed From 60d1f6c780bdc5b0f22af21fbe20551df970b35f Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Fri, 2 Sep 2022 22:31:48 -0400 Subject: [PATCH 114/659] 105.0.5195.52 --- ...592cf8867f0cd6d8d41b43392fb52d359649.patch | 77 ---- ...02.0.5005.115-v8-aarch64-gcc-cfi-fix.patch | 26 -- ...mium-103.0.5060.53-python-six-1.16.0.patch | 360 ------------------ chromium-104-ContentRendererClient-type.patch | 28 -- ...um-105-AdjustMaskLayerGeometry-ceilf.patch | 41 ++ chromium-105-Bitmap-include.patch | 26 ++ chromium-105-Trap-raw_ptr.patch | 161 ++++++++ chromium-105-browser_finder-include.patch | 24 ++ chromium-105-raw_ptr-noexcept.patch | 30 ++ ... => chromium-105.0.5195.52-gn-system.patch | 23 +- ...mium-105.0.5195.52-python-six-1.16.0.patch | 134 +++++++ ...0.5195.52-update-wayland-client-core.patch | 31 ++ chromium.spec | 54 ++- sources | 2 +- 14 files changed, 493 insertions(+), 524 deletions(-) delete mode 100644 0fc6592cf8867f0cd6d8d41b43392fb52d359649.patch delete mode 100644 chromium-102.0.5005.115-v8-aarch64-gcc-cfi-fix.patch delete mode 100644 chromium-103.0.5060.53-python-six-1.16.0.patch delete mode 100644 chromium-104-ContentRendererClient-type.patch create mode 100644 chromium-105-AdjustMaskLayerGeometry-ceilf.patch create mode 100644 chromium-105-Bitmap-include.patch create mode 100644 chromium-105-Trap-raw_ptr.patch create mode 100644 chromium-105-browser_finder-include.patch create mode 100644 chromium-105-raw_ptr-noexcept.patch rename chromium-67.0.3396.62-gn-system.patch => chromium-105.0.5195.52-gn-system.patch (78%) create mode 100644 chromium-105.0.5195.52-python-six-1.16.0.patch create mode 100644 chromium-105.0.5195.52-update-wayland-client-core.patch diff --git a/0fc6592cf8867f0cd6d8d41b43392fb52d359649.patch b/0fc6592cf8867f0cd6d8d41b43392fb52d359649.patch deleted file mode 100644 index 7152988..0000000 --- a/0fc6592cf8867f0cd6d8d41b43392fb52d359649.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 0fc6592cf8867f0cd6d8d41b43392fb52d359649 Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Tue, 7 Jun 2022 15:44:35 +0200 -Subject: [PATCH] GCC: fix compilation of NEON64 extract_first_nonzero_index -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -GCC fails to compile extract_first_nonzero_index because of the -signedness type mismatch in the NEON intrinsics. - -Bug: chromium:819294 -Change-Id: I9b73e5fa1d5fbf161740ab1b5d77f5c494369dfa -Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3693709 -Reviewed-by: Toon Verwaest -Commit-Queue: José Dapena Paz -Cr-Commit-Position: refs/heads/main@{#81063} ---- - v8/src/objects/simd.cc | 27 ++++++++++++--------------- - 1 file changed, 12 insertions(+), 15 deletions(-) - -diff --git a/v8/src/objects/simd.cc b/v8/rc/objects/simd.cc -index d3cedfe3302..0a73b9c686d 100644 ---- a/v8/src/objects/simd.cc -+++ b/v8/src/objects/simd.cc -@@ -95,24 +95,21 @@ inline int extract_first_nonzero_index(T v) { - } - - template <> --inline int extract_first_nonzero_index(int32x4_t v) { -- int32x4_t mask = {4, 3, 2, 1}; -+inline int extract_first_nonzero_index(uint32x4_t v) { -+ uint32x4_t mask = {4, 3, 2, 1}; - mask = vandq_u32(mask, v); - return 4 - vmaxvq_u32(mask); - } - - template <> --inline int extract_first_nonzero_index(int64x2_t v) { -- int32x4_t mask = {2, 0, 1, 0}; // Could also be {2,2,1,1} or {0,2,0,1} -- mask = vandq_u32(mask, vreinterpretq_s32_s64(v)); -+inline int extract_first_nonzero_index(uint64x2_t v) { -+ uint32x4_t mask = {2, 0, 1, 0}; // Could also be {2,2,1,1} or {0,2,0,1} -+ mask = vandq_u32(mask, vreinterpretq_u32_u64(v)); - return 2 - vmaxvq_u32(mask); - } - --template <> --inline int extract_first_nonzero_index(float64x2_t v) { -- int32x4_t mask = {2, 0, 1, 0}; // Could also be {2,2,1,1} or {0,2,0,1} -- mask = vandq_u32(mask, vreinterpretq_s32_f64(v)); -- return 2 - vmaxvq_u32(mask); -+inline int32_t reinterpret_vmaxvq_u64(uint64x2_t v) { -+ return vmaxvq_u32(vreinterpretq_u32_u64(v)); - } - #endif - -@@ -204,14 +201,14 @@ inline uintptr_t fast_search_noavx(T* array, uintptr_t array_len, - } - #elif defined(NEON64) - if constexpr (std::is_same::value) { -- VECTORIZED_LOOP_Neon(int32x4_t, int32x4_t, vdupq_n_u32, vceqq_u32, -+ VECTORIZED_LOOP_Neon(uint32x4_t, uint32x4_t, vdupq_n_u32, vceqq_u32, - vmaxvq_u32) - } else if constexpr (std::is_same::value) { -- VECTORIZED_LOOP_Neon(int64x2_t, int64x2_t, vdupq_n_u64, vceqq_u64, -- vmaxvq_u32) -+ VECTORIZED_LOOP_Neon(uint64x2_t, uint64x2_t, vdupq_n_u64, vceqq_u64, -+ reinterpret_vmaxvq_u64) - } else if constexpr (std::is_same::value) { -- VECTORIZED_LOOP_Neon(float64x2_t, float64x2_t, vdupq_n_f64, vceqq_f64, -- vmaxvq_f64) -+ VECTORIZED_LOOP_Neon(float64x2_t, uint64x2_t, vdupq_n_f64, vceqq_f64, -+ reinterpret_vmaxvq_u64) - } - #else - UNREACHABLE(); diff --git a/chromium-102.0.5005.115-v8-aarch64-gcc-cfi-fix.patch b/chromium-102.0.5005.115-v8-aarch64-gcc-cfi-fix.patch deleted file mode 100644 index 5c0200a..0000000 --- a/chromium-102.0.5005.115-v8-aarch64-gcc-cfi-fix.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -up chromium-102.0.5005.115/v8/src/execution/arm64/pointer-authentication-arm64.h.gcc-cfi-fix chromium-102.0.5005.115/v8/src/execution/arm64/pointer-authentication-arm64.h ---- chromium-102.0.5005.115/v8/src/execution/arm64/pointer-authentication-arm64.h.gcc-cfi-fix 2022-06-14 16:34:21.710049421 -0400 -+++ chromium-102.0.5005.115/v8/src/execution/arm64/pointer-authentication-arm64.h 2022-06-14 16:35:17.650427761 -0400 -@@ -47,15 +47,17 @@ V8_INLINE Address PointerAuthentication: - #ifdef USE_SIMULATOR - return Simulator::StripPAC(pc, Simulator::kInstructionPointer); - #else -+ // x30 == lr, but use 'x30' instead of 'lr' below, as GCC does not accept -+ // 'lr' in the clobbers list. - asm volatile( -- " mov x16, lr\n" -- " mov lr, %[pc]\n" -+ " mov x16, x30\n" -+ " mov x30, %[pc]\n" - " xpaclri\n" -- " mov %[pc], lr\n" -- " mov lr, x16\n" -+ " mov %[pc], x30\n" -+ " mov x30, x16\n" - : [pc] "+r"(pc) - : -- : "x16", "lr"); -+ : "x16", "x30"); - return pc; - #endif - } diff --git a/chromium-103.0.5060.53-python-six-1.16.0.patch b/chromium-103.0.5060.53-python-six-1.16.0.patch deleted file mode 100644 index 1213e3f..0000000 --- a/chromium-103.0.5060.53-python-six-1.16.0.patch +++ /dev/null @@ -1,360 +0,0 @@ -diff -up chromium-103.0.5060.53/third_party/catapult/third_party/six/six.py.116 chromium-103.0.5060.53/third_party/catapult/third_party/six/six.py ---- chromium-103.0.5060.53/third_party/catapult/third_party/six/six.py.116 2022-07-05 13:31:29.434673638 +0000 -+++ chromium-103.0.5060.53/third_party/catapult/third_party/six/six.py 2022-07-05 21:52:01.884578748 +0000 -@@ -29,7 +29,7 @@ import sys - import types - - __author__ = "Benjamin Peterson " --__version__ = "1.15.0" -+__version__ = "1.16.0" - - - # Useful for very coarse version differentiation. -@@ -71,6 +71,11 @@ else: - MAXSIZE = int((1 << 63) - 1) - del X - -+if PY34: -+ from importlib.util import spec_from_loader -+else: -+ spec_from_loader = None -+ - - def _add_doc(func, doc): - """Add documentation to a function.""" -@@ -186,6 +191,11 @@ class _SixMetaPathImporter(object): - return self - return None - -+ def find_spec(self, fullname, path, target=None): -+ if fullname in self.known_modules: -+ return spec_from_loader(fullname, self) -+ return None -+ - def __get_module(self, fullname): - try: - return self.known_modules[fullname] -@@ -223,6 +233,12 @@ class _SixMetaPathImporter(object): - return None - get_source = get_code # same as get_code - -+ def create_module(self, spec): -+ return self.load_module(spec.name) -+ -+ def exec_module(self, module): -+ pass -+ - _importer = _SixMetaPathImporter(__name__) - - -diff -up chromium-103.0.5060.53/third_party/protobuf/third_party/six/six.py.116 chromium-103.0.5060.53/third_party/protobuf/third_party/six/six.py ---- chromium-103.0.5060.53/third_party/protobuf/third_party/six/six.py.116 2022-07-05 13:32:17.815058318 +0000 -+++ chromium-103.0.5060.53/third_party/protobuf/third_party/six/six.py 2022-07-05 22:00:28.139721738 +0000 -@@ -1,4 +1,4 @@ --# Copyright (c) 2010-2018 Benjamin Peterson -+# Copyright (c) 2010-2020 Benjamin Peterson - # - # Permission is hereby granted, free of charge, to any person obtaining a copy - # of this software and associated documentation files (the "Software"), to deal -@@ -29,7 +29,7 @@ import sys - import types - - __author__ = "Benjamin Peterson " --__version__ = "1.12.0" -+__version__ = "1.16.0" - - - # Useful for very coarse version differentiation. -@@ -71,6 +71,11 @@ else: - MAXSIZE = int((1 << 63) - 1) - del X - -+if PY34: -+ from importlib.util import spec_from_loader -+else: -+ spec_from_loader = None -+ - - def _add_doc(func, doc): - """Add documentation to a function.""" -@@ -186,6 +191,11 @@ class _SixMetaPathImporter(object): - return self - return None - -+ def find_spec(self, fullname, path, target=None): -+ if fullname in self.known_modules: -+ return spec_from_loader(fullname, self) -+ return None -+ - def __get_module(self, fullname): - try: - return self.known_modules[fullname] -@@ -223,6 +233,12 @@ class _SixMetaPathImporter(object): - return None - get_source = get_code # same as get_code - -+ def create_module(self, spec): -+ return self.load_module(spec.name) -+ -+ def exec_module(self, module): -+ pass -+ - _importer = _SixMetaPathImporter(__name__) - - -@@ -255,9 +271,11 @@ _moved_attributes = [ - MovedAttribute("zip_longest", "itertools", "itertools", "izip_longest", "zip_longest"), - MovedModule("builtins", "__builtin__"), - MovedModule("configparser", "ConfigParser"), -+ MovedModule("collections_abc", "collections", "collections.abc" if sys.version_info >= (3, 3) else "collections"), - MovedModule("copyreg", "copy_reg"), - MovedModule("dbm_gnu", "gdbm", "dbm.gnu"), -- MovedModule("_dummy_thread", "dummy_thread", "_dummy_thread"), -+ MovedModule("dbm_ndbm", "dbm", "dbm.ndbm"), -+ MovedModule("_dummy_thread", "dummy_thread", "_dummy_thread" if sys.version_info < (3, 9) else "_thread"), - MovedModule("http_cookiejar", "cookielib", "http.cookiejar"), - MovedModule("http_cookies", "Cookie", "http.cookies"), - MovedModule("html_entities", "htmlentitydefs", "html.entities"), -@@ -637,13 +655,16 @@ if PY3: - import io - StringIO = io.StringIO - BytesIO = io.BytesIO -+ del io - _assertCountEqual = "assertCountEqual" - if sys.version_info[1] <= 1: - _assertRaisesRegex = "assertRaisesRegexp" - _assertRegex = "assertRegexpMatches" -+ _assertNotRegex = "assertNotRegexpMatches" - else: - _assertRaisesRegex = "assertRaisesRegex" - _assertRegex = "assertRegex" -+ _assertNotRegex = "assertNotRegex" - else: - def b(s): - return s -@@ -665,6 +686,7 @@ else: - _assertCountEqual = "assertItemsEqual" - _assertRaisesRegex = "assertRaisesRegexp" - _assertRegex = "assertRegexpMatches" -+ _assertNotRegex = "assertNotRegexpMatches" - _add_doc(b, """Byte literal""") - _add_doc(u, """Text literal""") - -@@ -681,6 +703,10 @@ def assertRegex(self, *args, **kwargs): - return getattr(self, _assertRegex)(*args, **kwargs) - - -+def assertNotRegex(self, *args, **kwargs): -+ return getattr(self, _assertNotRegex)(*args, **kwargs) -+ -+ - if PY3: - exec_ = getattr(moves.builtins, "exec") - -@@ -716,16 +742,7 @@ else: - """) - - --if sys.version_info[:2] == (3, 2): -- exec_("""def raise_from(value, from_value): -- try: -- if from_value is None: -- raise value -- raise value from from_value -- finally: -- value = None --""") --elif sys.version_info[:2] > (3, 2): -+if sys.version_info[:2] > (3,): - exec_("""def raise_from(value, from_value): - try: - raise value from from_value -@@ -805,13 +822,33 @@ if sys.version_info[:2] < (3, 3): - _add_doc(reraise, """Reraise an exception.""") - - if sys.version_info[0:2] < (3, 4): -+ # This does exactly the same what the :func:`py3:functools.update_wrapper` -+ # function does on Python versions after 3.2. It sets the ``__wrapped__`` -+ # attribute on ``wrapper`` object and it doesn't raise an error if any of -+ # the attributes mentioned in ``assigned`` and ``updated`` are missing on -+ # ``wrapped`` object. -+ def _update_wrapper(wrapper, wrapped, -+ assigned=functools.WRAPPER_ASSIGNMENTS, -+ updated=functools.WRAPPER_UPDATES): -+ for attr in assigned: -+ try: -+ value = getattr(wrapped, attr) -+ except AttributeError: -+ continue -+ else: -+ setattr(wrapper, attr, value) -+ for attr in updated: -+ getattr(wrapper, attr).update(getattr(wrapped, attr, {})) -+ wrapper.__wrapped__ = wrapped -+ return wrapper -+ _update_wrapper.__doc__ = functools.update_wrapper.__doc__ -+ - def wraps(wrapped, assigned=functools.WRAPPER_ASSIGNMENTS, - updated=functools.WRAPPER_UPDATES): -- def wrapper(f): -- f = functools.wraps(wrapped, assigned, updated)(f) -- f.__wrapped__ = wrapped -- return f -- return wrapper -+ return functools.partial(_update_wrapper, wrapped=wrapped, -+ assigned=assigned, updated=updated) -+ wraps.__doc__ = functools.wraps.__doc__ -+ - else: - wraps = functools.wraps - -@@ -824,7 +861,15 @@ def with_metaclass(meta, *bases): - class metaclass(type): - - def __new__(cls, name, this_bases, d): -- return meta(name, bases, d) -+ if sys.version_info[:2] >= (3, 7): -+ # This version introduced PEP 560 that requires a bit -+ # of extra care (we mimic what is done by __build_class__). -+ resolved_bases = types.resolve_bases(bases) -+ if resolved_bases is not bases: -+ d['__orig_bases__'] = bases -+ else: -+ resolved_bases = bases -+ return meta(name, resolved_bases, d) - - @classmethod - def __prepare__(cls, name, this_bases): -@@ -861,12 +906,11 @@ def ensure_binary(s, encoding='utf-8', e - - `str` -> encoded to `bytes` - - `bytes` -> `bytes` - """ -+ if isinstance(s, binary_type): -+ return s - if isinstance(s, text_type): - return s.encode(encoding, errors) -- elif isinstance(s, binary_type): -- return s -- else: -- raise TypeError("not expecting type '%s'" % type(s)) -+ raise TypeError("not expecting type '%s'" % type(s)) - - - def ensure_str(s, encoding='utf-8', errors='strict'): -@@ -880,12 +924,15 @@ def ensure_str(s, encoding='utf-8', erro - - `str` -> `str` - - `bytes` -> decoded to `str` - """ -- if not isinstance(s, (text_type, binary_type)): -- raise TypeError("not expecting type '%s'" % type(s)) -+ # Optimization: Fast return for the common case. -+ if type(s) is str: -+ return s - if PY2 and isinstance(s, text_type): -- s = s.encode(encoding, errors) -+ return s.encode(encoding, errors) - elif PY3 and isinstance(s, binary_type): -- s = s.decode(encoding, errors) -+ return s.decode(encoding, errors) -+ elif not isinstance(s, (text_type, binary_type)): -+ raise TypeError("not expecting type '%s'" % type(s)) - return s - - -@@ -908,10 +955,9 @@ def ensure_text(s, encoding='utf-8', err - raise TypeError("not expecting type '%s'" % type(s)) - - -- - def python_2_unicode_compatible(klass): - """ -- A decorator that defines __unicode__ and __str__ methods under Python 2. -+ A class decorator that defines __unicode__ and __str__ methods under Python 2. - Under Python 3 it does nothing. - - To support Python 2 and 3 with a single code base, define a __str__ method -diff -up chromium-103.0.5060.53/third_party/six/src/six.py.116 chromium-103.0.5060.53/third_party/six/src/six.py ---- chromium-103.0.5060.53/third_party/six/src/six.py.116 2022-07-05 13:32:28.916687658 +0000 -+++ chromium-103.0.5060.53/third_party/six/src/six.py 2022-07-05 21:59:42.561240407 +0000 -@@ -29,7 +29,7 @@ import sys - import types - - __author__ = "Benjamin Peterson " --__version__ = "1.14.0" -+__version__ = "1.16.0" - - - # Useful for very coarse version differentiation. -@@ -71,6 +71,11 @@ else: - MAXSIZE = int((1 << 63) - 1) - del X - -+if PY34: -+ from importlib.util import spec_from_loader -+else: -+ spec_from_loader = None -+ - - def _add_doc(func, doc): - """Add documentation to a function.""" -@@ -186,6 +191,11 @@ class _SixMetaPathImporter(object): - return self - return None - -+ def find_spec(self, fullname, path, target=None): -+ if fullname in self.known_modules: -+ return spec_from_loader(fullname, self) -+ return None -+ - def __get_module(self, fullname): - try: - return self.known_modules[fullname] -@@ -223,6 +233,12 @@ class _SixMetaPathImporter(object): - return None - get_source = get_code # same as get_code - -+ def create_module(self, spec): -+ return self.load_module(spec.name) -+ -+ def exec_module(self, module): -+ pass -+ - _importer = _SixMetaPathImporter(__name__) - - -@@ -890,12 +906,11 @@ def ensure_binary(s, encoding='utf-8', e - - `str` -> encoded to `bytes` - - `bytes` -> `bytes` - """ -+ if isinstance(s, binary_type): -+ return s - if isinstance(s, text_type): - return s.encode(encoding, errors) -- elif isinstance(s, binary_type): -- return s -- else: -- raise TypeError("not expecting type '%s'" % type(s)) -+ raise TypeError("not expecting type '%s'" % type(s)) - - - def ensure_str(s, encoding='utf-8', errors='strict'): -@@ -909,12 +924,15 @@ def ensure_str(s, encoding='utf-8', erro - - `str` -> `str` - - `bytes` -> decoded to `str` - """ -- if not isinstance(s, (text_type, binary_type)): -- raise TypeError("not expecting type '%s'" % type(s)) -+ # Optimization: Fast return for the common case. -+ if type(s) is str: -+ return s - if PY2 and isinstance(s, text_type): -- s = s.encode(encoding, errors) -+ return s.encode(encoding, errors) - elif PY3 and isinstance(s, binary_type): -- s = s.decode(encoding, errors) -+ return s.decode(encoding, errors) -+ elif not isinstance(s, (text_type, binary_type)): -+ raise TypeError("not expecting type '%s'" % type(s)) - return s - - diff --git a/chromium-104-ContentRendererClient-type.patch b/chromium-104-ContentRendererClient-type.patch deleted file mode 100644 index a6d5a86..0000000 --- a/chromium-104-ContentRendererClient-type.patch +++ /dev/null @@ -1,28 +0,0 @@ -From a61a70605f9efc81fead5bf6984bc5ce39f1569d Mon Sep 17 00:00:00 2001 -From: Stephan Hartmann -Date: Fri, 27 May 2022 18:11:52 +0000 -Subject: [PATCH] libstdc++: fix incomplete type of - content::ContentRendererClient - -Destructor of std::unique_ptr in libstdc++ uses sizeof() which -requires full definition of media::AudioEncoder for return type of -cast_streaming::ResourceProvider. ---- - content/public/renderer/content_renderer_client.cc | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/content/public/renderer/content_renderer_client.cc b/content/public/renderer/content_renderer_client.cc -index 63456aa..637a2a7 100644 ---- a/content/public/renderer/content_renderer_client.cc -+++ b/content/public/renderer/content_renderer_client.cc -@@ -6,6 +6,7 @@ - - #include "base/command_line.h" - #include "build/build_config.h" -+#include "components/cast_streaming/renderer/public/resource_provider.h" - #include "content/public/common/content_switches.h" - #include "media/base/demuxer.h" - #include "media/base/renderer_factory.h" --- -2.35.1 - diff --git a/chromium-105-AdjustMaskLayerGeometry-ceilf.patch b/chromium-105-AdjustMaskLayerGeometry-ceilf.patch new file mode 100644 index 0000000..e347fa0 --- /dev/null +++ b/chromium-105-AdjustMaskLayerGeometry-ceilf.patch @@ -0,0 +1,41 @@ +From 385068e1eb1cde9629d18ceee1fd13255c70c806 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Fri, 22 Jul 2022 18:29:24 +0000 +Subject: [PATCH] libstdc++: use math.h in blink::AdjustMaskLayerGeometry + +libstdc++ does not implement std::ceilf. Use ceilf from math.h +instead. + +Bug: 957519 +Change-Id: I03b5e0a1eb73fdeae34d5f3d2f2e9c8871c52543 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3782841 +Commit-Queue: Stephan Hartmann +Reviewed-by: Juanmi Huertas +Cr-Commit-Position: refs/heads/main@{#1027342} +--- + +diff --git a/third_party/blink/renderer/platform/graphics/compositing/adjust_mask_layer_geometry.cc b/third_party/blink/renderer/platform/graphics/compositing/adjust_mask_layer_geometry.cc +index 4abe1d9..b5b43da 100644 +--- a/third_party/blink/renderer/platform/graphics/compositing/adjust_mask_layer_geometry.cc ++++ b/third_party/blink/renderer/platform/graphics/compositing/adjust_mask_layer_geometry.cc +@@ -4,8 +4,9 @@ + + #include "third_party/blink/renderer/platform/graphics/compositing/adjust_mask_layer_geometry.h" + ++#include + #include +-#include ++ + #include "third_party/blink/renderer/platform/graphics/paint/geometry_mapper.h" + #include "third_party/blink/renderer/platform/graphics/paint/transform_paint_property_node.h" + #include "ui/gfx/geometry/size.h" +@@ -29,8 +30,7 @@ + // Map a screen pixel into the layer. + GeometryMapper::SourceToDestinationRect(TransformPaintPropertyNode::Root(), + transform, pixel_rect); +- int outset = +- std::ceilf(std::max(pixel_rect.width(), pixel_rect.height()) * 2); ++ int outset = ceilf(std::max(pixel_rect.width(), pixel_rect.height()) * 2); + // Don't expand too far in extreme cases. + constexpr int kMaxOutset = 1000; + outset = std::min(kMaxOutset, outset); diff --git a/chromium-105-Bitmap-include.patch b/chromium-105-Bitmap-include.patch new file mode 100644 index 0000000..75d0161 --- /dev/null +++ b/chromium-105-Bitmap-include.patch @@ -0,0 +1,26 @@ +From 8959d9d1c6e4ed083c278ab9e8def20a409052b9 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Fri, 22 Jul 2022 16:51:28 +0000 +Subject: [PATCH] IWYU: add memory for std::unique_ptr in disk_cache::Bitmap + +Bug: 957519 +Change-Id: I123198345e5f9062329b7eabe980f312525c268b +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3779530 +Reviewed-by: Maks Orlovich +Commit-Queue: Stephan Hartmann +Cr-Commit-Position: refs/heads/main@{#1027289} +--- + +diff --git a/net/disk_cache/blockfile/bitmap.h b/net/disk_cache/blockfile/bitmap.h +index 07806cf..9ffa98b9 100644 +--- a/net/disk_cache/blockfile/bitmap.h ++++ b/net/disk_cache/blockfile/bitmap.h +@@ -8,6 +8,8 @@ + #include + #include + ++#include ++ + #include "base/memory/raw_ptr.h" + #include "net/base/net_export.h" + diff --git a/chromium-105-Trap-raw_ptr.patch b/chromium-105-Trap-raw_ptr.patch new file mode 100644 index 0000000..d784052 --- /dev/null +++ b/chromium-105-Trap-raw_ptr.patch @@ -0,0 +1,161 @@ +From 632aad0141fe0008fa9babba4f1f514222fa2cda Mon Sep 17 00:00:00 2001 +From: Matthew Denton +Date: Mon, 01 Aug 2022 21:45:28 +0000 +Subject: [PATCH] [Linux sandbox] cleanup TrapRegistry's "atomics" + +TrapRegistry uses some hacky asm statements as compiler memory barriers +to prevent a signal handler from accessing a deleted array (in the case +that the store of the pointer to the new array is reordered after the +deletion of the old array and the signal handler grabs a pointer to the +old array after it's deleted). + +We have std::atomic_signal_fence for this now, so this uses it. + +This also changes the |trap_array_| pointer back to a raw pointer from +a raw_ptr. Usage of raw_ptr might be awkward as it is also accessed in +a signal handler, and in fact |trap_array_| is an owning pointer +anyway so raw_ptr is unnecessary. + +This came up in https://crrev.com/c/3789266 in which the use of raw_ptr +with the hacky compiler barriers was not supported by GCC. + +SMALL ADDITION: This also removes raw_ptr from the arch_sigsys struct; it was a raw pointer to a code instruction and likely would not have worked. It is also never dereferenced (only its value is used). + +NOTE 1: In technicality, all non-local variables accessed by the signal +handler must be either lock-free std::atomics or volatile sig_atomic_t. +None of Chrome's code does this and in fact, glibc just typedefs +sig_atomic_t to int. The std::atomic_signal_fence is enough on any +architecture. + +NOTE 2: This race condition is unlikely to ever happen even without +compiler barriers. The only time we might be modifying the +|trap_array_| and also accessing it from a signal handler, we must +have already applied a seccomp sandbox that uses traps, and now be +applying another one that uses traps. And to replace the deleted object, +the second sandbox must be getting applied in a multithreaded +environment, otherwise there would be no allocations after the free. + +Bug: 819294 + +Change-Id: I9f1cd417446dd863805a303e9b111bc862cb9ae2 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3788911 +Commit-Queue: Matthew Denton +Reviewed-by: Tom Sepez +Cr-Commit-Position: refs/heads/main@{#1030277} +--- + +diff --git a/sandbox/linux/seccomp-bpf/trap.cc b/sandbox/linux/seccomp-bpf/trap.cc +index cb71a9b..b0c0257 100644 +--- a/sandbox/linux/seccomp-bpf/trap.cc ++++ b/sandbox/linux/seccomp-bpf/trap.cc +@@ -12,12 +12,13 @@ + #include + + #include ++#include + #include + #include + + #include "base/compiler_specific.h" + #include "base/logging.h" +-#include "base/memory/raw_ptr.h" ++#include "base/memory/raw_ptr_exclusion.h" + #include "build/build_config.h" + #include "sandbox/linux/bpf_dsl/seccomp_macros.h" + #include "sandbox/linux/seccomp-bpf/die.h" +@@ -29,7 +30,9 @@ + namespace { + + struct arch_sigsys { +- raw_ptr ip; ++ // This is not raw_ptr because it is a pointer to a code address given to us ++ // by the kernel. ++ RAW_PTR_EXCLUSION void* ip; + int nr; + unsigned int arch; + }; +@@ -77,11 +80,7 @@ + + namespace sandbox { + +-Trap::Trap() +- : trap_array_(nullptr), +- trap_array_size_(0), +- trap_array_capacity_(0), +- has_unsafe_traps_(false) { ++Trap::Trap() { + // Set new SIGSYS handler + struct sigaction sa = {}; + // In some toolchain, sa_sigaction is not declared in struct sigaction. +@@ -239,7 +238,7 @@ + struct arch_seccomp_data data = { + static_cast(SECCOMP_SYSCALL(ctx)), + SECCOMP_ARCH, +- reinterpret_cast(sigsys.ip.get()), ++ reinterpret_cast(sigsys.ip), + {static_cast(SECCOMP_PARM1(ctx)), + static_cast(SECCOMP_PARM2(ctx)), + static_cast(SECCOMP_PARM3(ctx)), +@@ -333,24 +332,11 @@ + TrapKey* new_trap_array = new TrapKey[trap_array_capacity_]; + std::copy_n(old_trap_array, trap_array_size_, new_trap_array); + +- // Language specs are unclear on whether the compiler is allowed to move +- // the "delete[]" above our preceding assignments and/or memory moves, +- // iff the compiler believes that "delete[]" doesn't have any other +- // global side-effects. +- // We insert optimization barriers to prevent this from happening. +- // The first barrier is probably not needed, but better be explicit in +- // what we want to tell the compiler. +- // The clang developer mailing list couldn't answer whether this is a +- // legitimate worry; but they at least thought that the barrier is +- // sufficient to prevent the (so far hypothetical) problem of re-ordering +- // of instructions by the compiler. +- // +- // TODO(mdempsky): Try to clean this up using base/atomicops or C++11 +- // atomics; see crbug.com/414363. +- asm volatile("" : "=r"(new_trap_array) : "0"(new_trap_array) : "memory"); + trap_array_ = new_trap_array; +- asm volatile("" : "=r"(trap_array_) : "0"(trap_array_) : "memory"); +- ++ // Prevent the compiler from moving delete[] before the store of the ++ // |new_trap_array|, otherwise a concurrent SIGSYS may see a |trap_array_| ++ // that still points to |old_trap_array| after it has been deleted. ++ std::atomic_signal_fence(std::memory_order_release); + delete[] old_trap_array; + } + +diff --git a/sandbox/linux/seccomp-bpf/trap.h b/sandbox/linux/seccomp-bpf/trap.h +index cc17d26..37d2029 100644 +--- a/sandbox/linux/seccomp-bpf/trap.h ++++ b/sandbox/linux/seccomp-bpf/trap.h +@@ -10,7 +10,7 @@ + + #include + +-#include "base/memory/raw_ptr.h" ++#include "base/memory/raw_ptr_exclusion.h" + #include "sandbox/linux/bpf_dsl/trap_registry.h" + #include "sandbox/linux/system_headers/linux_signal.h" + #include "sandbox/sandbox_export.h" +@@ -75,11 +75,15 @@ + // events. + static Trap* global_trap_; + +- TrapIds trap_ids_; // Maps from TrapKeys to numeric ids +- raw_ptr trap_array_; // Array of TrapKeys indexed by ids +- size_t trap_array_size_; // Currently used size of array +- size_t trap_array_capacity_; // Currently allocated capacity of array +- bool has_unsafe_traps_; // Whether unsafe traps have been enabled ++ TrapIds trap_ids_; // Maps from TrapKeys to numeric ids ++ // Array of TrapKeys indexed by ids. ++ // ++ // This is not a raw_ptr as it is an owning pointer anyway, and is meant to be ++ // used between normal code and signal handlers. ++ RAW_PTR_EXCLUSION TrapKey* trap_array_ = nullptr; ++ size_t trap_array_size_ = 0; // Currently used size of array ++ size_t trap_array_capacity_ = 0; // Currently allocated capacity of array ++ bool has_unsafe_traps_ = false; // Whether unsafe traps have been enabled + }; + + } // namespace sandbox diff --git a/chromium-105-browser_finder-include.patch b/chromium-105-browser_finder-include.patch new file mode 100644 index 0000000..ab46427 --- /dev/null +++ b/chromium-105-browser_finder-include.patch @@ -0,0 +1,24 @@ +From 41dca8bd0c5e8ac5197d7477c6f01556fb88fb43 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Sun, 14 Aug 2022 08:41:11 +0000 +Subject: [PATCH] IWYU: add vector for std::vector in browser_finder.h + +--- + chrome/browser/ui/browser_finder.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/chrome/browser/ui/browser_finder.h b/chrome/browser/ui/browser_finder.h +index f885be0..ad7a184 100644 +--- a/chrome/browser/ui/browser_finder.h ++++ b/chrome/browser/ui/browser_finder.h +@@ -6,6 +6,7 @@ + #define CHROME_BROWSER_UI_BROWSER_FINDER_H_ + + #include ++#include + + #include "ui/display/types/display_constants.h" + #include "ui/gfx/native_widget_types.h" +-- +2.35.1 + diff --git a/chromium-105-raw_ptr-noexcept.patch b/chromium-105-raw_ptr-noexcept.patch new file mode 100644 index 0000000..0c32524 --- /dev/null +++ b/chromium-105-raw_ptr-noexcept.patch @@ -0,0 +1,30 @@ +From 72b19a6a725809f872a7e7525c9a83bcbda85ec7 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Mon, 25 Jul 2022 09:19:19 +0000 +Subject: [PATCH] GCC: make raw_ptr move assignment operator noexcept + +Required in content::LevelDBScopesOptions, because move assignment +operator is noexcept too. + +Bug: 3762913 +Change-Id: Ic55ade0e15457eb7349fe24203307972d9030a8e +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3782669 +Reviewed-by: Keishi Hattori +Commit-Queue: Stephan Hartmann +Reviewed-by: Bartek Nowierski +Cr-Commit-Position: refs/heads/main@{#1027669} +--- + +diff --git a/base/memory/raw_ptr.h b/base/memory/raw_ptr.h +index 5d8c1cfd..9a62f03 100644 +--- a/base/memory/raw_ptr.h ++++ b/base/memory/raw_ptr.h +@@ -796,7 +796,7 @@ + return *this; + } + +- ALWAYS_INLINE raw_ptr& operator=(raw_ptr&& p) { ++ ALWAYS_INLINE raw_ptr& operator=(raw_ptr&& p) noexcept { + if (LIKELY(this != &p)) { + Impl::ReleaseWrappedPtr(wrapped_ptr_); + wrapped_ptr_ = p.wrapped_ptr_; diff --git a/chromium-67.0.3396.62-gn-system.patch b/chromium-105.0.5195.52-gn-system.patch similarity index 78% rename from chromium-67.0.3396.62-gn-system.patch rename to chromium-105.0.5195.52-gn-system.patch index 4a08e94..e8c0bcc 100644 --- a/chromium-67.0.3396.62-gn-system.patch +++ b/chromium-105.0.5195.52-gn-system.patch @@ -1,7 +1,6 @@ -diff -up chromium-67.0.3396.62/build/linux/unbundle/libjpeg.gn.gnsystem chromium-67.0.3396.62/build/linux/unbundle/libjpeg.gn -diff -up chromium-67.0.3396.62/build/linux/unbundle/libusb.gn.gnsystem chromium-67.0.3396.62/build/linux/unbundle/libusb.gn ---- chromium-67.0.3396.62/build/linux/unbundle/libusb.gn.gnsystem 2018-05-30 12:18:36.949488683 -0400 -+++ chromium-67.0.3396.62/build/linux/unbundle/libusb.gn 2018-05-30 12:18:36.949488683 -0400 +diff -up chromium-105.0.5195.52/build/linux/unbundle/libusb.gn.gnsystem chromium-105.0.5195.52/build/linux/unbundle/libusb.gn +--- chromium-105.0.5195.52/build/linux/unbundle/libusb.gn.gnsystem 2022-09-01 12:23:27.557313611 +0000 ++++ chromium-105.0.5195.52/build/linux/unbundle/libusb.gn 2022-09-01 12:23:27.557313611 +0000 @@ -0,0 +1,24 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be @@ -27,9 +26,9 @@ diff -up chromium-67.0.3396.62/build/linux/unbundle/libusb.gn.gnsystem chromium- + ] + public_configs = [ ":system_libusb" ] +} -diff -up chromium-67.0.3396.62/build/linux/unbundle/opus.gn.gnsystem chromium-67.0.3396.62/build/linux/unbundle/opus.gn ---- chromium-67.0.3396.62/build/linux/unbundle/opus.gn.gnsystem 2018-05-30 04:43:03.000000000 -0400 -+++ chromium-67.0.3396.62/build/linux/unbundle/opus.gn 2018-05-30 12:18:36.950488661 -0400 +diff -up chromium-105.0.5195.52/build/linux/unbundle/opus.gn.gnsystem chromium-105.0.5195.52/build/linux/unbundle/opus.gn +--- chromium-105.0.5195.52/build/linux/unbundle/opus.gn.gnsystem 2022-08-24 20:27:57.000000000 +0000 ++++ chromium-105.0.5195.52/build/linux/unbundle/opus.gn 2022-09-01 12:41:57.564878845 +0000 @@ -1,3 +1,164 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be @@ -195,12 +194,12 @@ diff -up chromium-67.0.3396.62/build/linux/unbundle/opus.gn.gnsystem chromium-67 # Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -diff -up chromium-67.0.3396.62/build/linux/unbundle/replace_gn_files.py.gnsystem chromium-67.0.3396.62/build/linux/unbundle/replace_gn_files.py ---- chromium-67.0.3396.62/build/linux/unbundle/replace_gn_files.py.gnsystem 2018-05-30 12:18:36.951488638 -0400 -+++ chromium-67.0.3396.62/build/linux/unbundle/replace_gn_files.py 2018-05-30 12:20:02.542534270 -0400 -@@ -27,6 +27,7 @@ REPLACEMENTS = { - 'libevent': 'base/third_party/libevent/BUILD.gn', +diff -up chromium-105.0.5195.52/build/linux/unbundle/replace_gn_files.py.gnsystem chromium-105.0.5195.52/build/linux/unbundle/replace_gn_files.py +--- chromium-105.0.5195.52/build/linux/unbundle/replace_gn_files.py.gnsystem 2022-09-01 12:23:27.558313577 +0000 ++++ chromium-105.0.5195.52/build/linux/unbundle/replace_gn_files.py 2022-09-01 12:36:01.870847125 +0000 +@@ -52,6 +52,7 @@ REPLACEMENTS = { 'libjpeg': 'third_party/libjpeg.gni', + 'libjxl' : 'third_party/libjxl/BUILD.gn', 'libpng': 'third_party/libpng/BUILD.gn', + 'libusb': 'third_party/libusb/BUILD.gn', 'libvpx': 'third_party/libvpx/BUILD.gn', diff --git a/chromium-105.0.5195.52-python-six-1.16.0.patch b/chromium-105.0.5195.52-python-six-1.16.0.patch new file mode 100644 index 0000000..497c2df --- /dev/null +++ b/chromium-105.0.5195.52-python-six-1.16.0.patch @@ -0,0 +1,134 @@ +diff -up chromium-103.0.5060.53/third_party/catapult/third_party/six/six.py.116 chromium-103.0.5060.53/third_party/catapult/third_party/six/six.py +--- chromium-103.0.5060.53/third_party/catapult/third_party/six/six.py.116 2022-07-05 13:31:29.434673638 +0000 ++++ chromium-103.0.5060.53/third_party/catapult/third_party/six/six.py 2022-07-05 21:52:01.884578748 +0000 +@@ -29,7 +29,7 @@ import sys + import types + + __author__ = "Benjamin Peterson " +-__version__ = "1.15.0" ++__version__ = "1.16.0" + + + # Useful for very coarse version differentiation. +@@ -71,6 +71,11 @@ else: + MAXSIZE = int((1 << 63) - 1) + del X + ++if PY34: ++ from importlib.util import spec_from_loader ++else: ++ spec_from_loader = None ++ + + def _add_doc(func, doc): + """Add documentation to a function.""" +@@ -186,6 +191,11 @@ class _SixMetaPathImporter(object): + return self + return None + ++ def find_spec(self, fullname, path, target=None): ++ if fullname in self.known_modules: ++ return spec_from_loader(fullname, self) ++ return None ++ + def __get_module(self, fullname): + try: + return self.known_modules[fullname] +@@ -223,6 +233,12 @@ class _SixMetaPathImporter(object): + return None + get_source = get_code # same as get_code + ++ def create_module(self, spec): ++ return self.load_module(spec.name) ++ ++ def exec_module(self, module): ++ pass ++ + _importer = _SixMetaPathImporter(__name__) + + +diff -up chromium-103.0.5060.53/third_party/six/src/six.py.116 chromium-103.0.5060.53/third_party/six/src/six.py +--- chromium-103.0.5060.53/third_party/six/src/six.py.116 2022-07-05 13:32:28.916687658 +0000 ++++ chromium-103.0.5060.53/third_party/six/src/six.py 2022-07-05 21:59:42.561240407 +0000 +@@ -29,7 +29,7 @@ import sys + import types + + __author__ = "Benjamin Peterson " +-__version__ = "1.14.0" ++__version__ = "1.16.0" + + + # Useful for very coarse version differentiation. +@@ -71,6 +71,11 @@ else: + MAXSIZE = int((1 << 63) - 1) + del X + ++if PY34: ++ from importlib.util import spec_from_loader ++else: ++ spec_from_loader = None ++ + + def _add_doc(func, doc): + """Add documentation to a function.""" +@@ -186,6 +191,11 @@ class _SixMetaPathImporter(object): + return self + return None + ++ def find_spec(self, fullname, path, target=None): ++ if fullname in self.known_modules: ++ return spec_from_loader(fullname, self) ++ return None ++ + def __get_module(self, fullname): + try: + return self.known_modules[fullname] +@@ -223,6 +233,12 @@ class _SixMetaPathImporter(object): + return None + get_source = get_code # same as get_code + ++ def create_module(self, spec): ++ return self.load_module(spec.name) ++ ++ def exec_module(self, module): ++ pass ++ + _importer = _SixMetaPathImporter(__name__) + + +@@ -890,12 +906,11 @@ def ensure_binary(s, encoding='utf-8', e + - `str` -> encoded to `bytes` + - `bytes` -> `bytes` + """ ++ if isinstance(s, binary_type): ++ return s + if isinstance(s, text_type): + return s.encode(encoding, errors) +- elif isinstance(s, binary_type): +- return s +- else: +- raise TypeError("not expecting type '%s'" % type(s)) ++ raise TypeError("not expecting type '%s'" % type(s)) + + + def ensure_str(s, encoding='utf-8', errors='strict'): +@@ -909,12 +924,15 @@ def ensure_str(s, encoding='utf-8', erro + - `str` -> `str` + - `bytes` -> decoded to `str` + """ +- if not isinstance(s, (text_type, binary_type)): +- raise TypeError("not expecting type '%s'" % type(s)) ++ # Optimization: Fast return for the common case. ++ if type(s) is str: ++ return s + if PY2 and isinstance(s, text_type): +- s = s.encode(encoding, errors) ++ return s.encode(encoding, errors) + elif PY3 and isinstance(s, binary_type): +- s = s.decode(encoding, errors) ++ return s.decode(encoding, errors) ++ elif not isinstance(s, (text_type, binary_type)): ++ raise TypeError("not expecting type '%s'" % type(s)) + return s + + diff --git a/chromium-105.0.5195.52-update-wayland-client-core.patch b/chromium-105.0.5195.52-update-wayland-client-core.patch new file mode 100644 index 0000000..86c5c22 --- /dev/null +++ b/chromium-105.0.5195.52-update-wayland-client-core.patch @@ -0,0 +1,31 @@ +diff -up chromium-105.0.5195.52/third_party/wayland/src/src/wayland-client-core.h.old-wayland chromium-105.0.5195.52/third_party/wayland/src/src/wayland-client-core.h +--- chromium-105.0.5195.52/third_party/wayland/src/src/wayland-client-core.h.old-wayland 2022-09-01 19:36:06.099483374 +0000 ++++ chromium-105.0.5195.52/third_party/wayland/src/src/wayland-client-core.h 2022-09-01 22:09:56.523353619 +0000 +@@ -119,9 +119,27 @@ struct wl_display; + */ + struct wl_event_queue; + ++/** Destroy proxy after marshalling ++ * @ingroup wl_proxy ++ */ ++#define WL_MARSHAL_FLAG_DESTROY (1 << 0) ++ + void + wl_event_queue_destroy(struct wl_event_queue *queue); + ++struct wl_proxy * ++wl_proxy_marshal_flags(struct wl_proxy *proxy, uint32_t opcode, ++ const struct wl_interface *interface, ++ uint32_t version, ++ uint32_t flags, ...); ++ ++struct wl_proxy * ++wl_proxy_marshal_array_flags(struct wl_proxy *proxy, uint32_t opcode, ++ const struct wl_interface *interface, ++ uint32_t version, ++ uint32_t flags, ++ union wl_argument *args); ++ + void + wl_proxy_marshal(struct wl_proxy *p, uint32_t opcode, ...); + diff --git a/chromium.spec b/chromium.spec index e4afb4c..d591fe0 100644 --- a/chromium.spec +++ b/chromium.spec @@ -220,14 +220,14 @@ BuildRequires: libicu-devel >= 5.4 %global chromoting_client_id %nil %endif -%global majorversion 104 +%global majorversion 105 %if %{freeworld} Name: chromium%{chromium_channel}%{nsuffix} %else Name: chromium%{chromium_channel} %endif -Version: %{majorversion}.0.5112.101 +Version: %{majorversion}.0.5195.52 Release: 1%{?dist} %if %{?freeworld} %if %{?shared} @@ -248,7 +248,7 @@ Patch0: chromium-70.0.3538.67-sandbox-pie.patch # Use /etc/chromium for initial_prefs Patch1: chromium-91.0.4472.77-initial_prefs-etc-path.patch # Use gn system files -Patch2: chromium-67.0.3396.62-gn-system.patch +Patch2: chromium-105.0.5195.52-gn-system.patch # Do not prefix libpng functions Patch3: chromium-60.0.3112.78-no-libpng-prefix.patch # Do not mangle libjpeg @@ -276,7 +276,7 @@ Patch51: chromium-96.0.4664.45-gcc-remoting-constexpr.patch # https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/files/chromium-unbundle-zlib.patch Patch52: chromium-81.0.4044.92-unbundle-zlib.patch # https://github.com/stha09/chromium-patches/blob/master/chromium-78-protobuf-RepeatedPtrField-export.patch -Patch55: chromium-78-protobuf-RepeatedPtrField-export.patch +# Patch55: chromium-78-protobuf-RepeatedPtrField-export.patch # ../../third_party/perfetto/include/perfetto/base/task_runner.h:48:55: error: 'uint32_t' has not been declared Patch56: chromium-96.0.4664.45-missing-cstdint-header.patch # Missing (thanks c++17) @@ -286,19 +286,15 @@ Patch57: chromium-96.0.4664.45-missing-cstring.patch Patch58: chromium-53-ffmpeg-no-deprecation-errors.patch # https://github.com/stha09/chromium-patches/blob/master/chromium-103-VirtualCursor-std-layout.patch Patch59: chromium-103-VirtualCursor-std-layout.patch -# https://github.com/stha09/chromium-patches/blob/master/chromium-104-ContentRendererClient-type.patch -Patch60: chromium-104-ContentRendererClient-type.patch +# https://github.com/stha09/chromium-patches/blob/master/chromium-105-AdjustMaskLayerGeometry-ceilf.patch +Patch60: chromium-105-AdjustMaskLayerGeometry-ceilf.patch # Fix headers to look for system paths when we are using system minizip Patch61: chromium-104.0.5112.101-system-minizip-header-fix.patch -# Fix v8 issue where GCC on arm64 fails to compile extract_first_nonzero_index because of the -# signedness type mismatch in the NEON intrinsics -# https://github.com/v8/v8/commit/0fc6592cf8867f0cd6d8d41b43392fb52d359649.patch -Patch62: 0fc6592cf8867f0cd6d8d41b43392fb52d359649.patch +# Update bundled copy of wayland-client-core.h +Patch62: chromium-105.0.5195.52-update-wayland-client-core.patch -# https://github.com/v8/v8/commit/2ed27bba6a881a152887f3ab1008e989fce617e3 -Patch63: chromium-102.0.5005.115-v8-aarch64-gcc-cfi-fix.patch # Extra CXXFLAGS for aarch64 Patch64: chromium-91.0.4472.77-aarch64-cxxflags-addition.patch # Fix issue where closure_compiler thinks java is only allowed in android builds @@ -317,7 +313,19 @@ Patch68: chromium-84.0.4147.125-i686-fix_textrels.patch Patch69: chromium-103.0.5060.53-update-rjsmin-to-1.2.0.patch # Update six to 1.16.0 -Patch70: chromium-103.0.5060.53-python-six-1.16.0.patch +Patch70: chromium-105.0.5195.52-python-six-1.16.0.patch + +# https://github.com/stha09/chromium-patches/blob/master/chromium-105-Bitmap-include.patch +Patch71: chromium-105-Bitmap-include.patch + +# https://github.com/stha09/chromium-patches/blob/master/chromium-105-browser_finder-include.patch +Patch72: chromium-105-browser_finder-include.patch + +# https://github.com/stha09/chromium-patches/blob/master/chromium-105-raw_ptr-noexcept.patch +Patch73: chromium-105-raw_ptr-noexcept.patch + +# https://github.com/stha09/chromium-patches/blob/master/chromium-105-Trap-raw_ptr.patch +Patch74: chromium-105-Trap-raw_ptr.patch # Do not download proprietary widevine module in the background (thanks Debian) Patch79: chromium-99.0.4844.51-widevine-no-download.patch @@ -1026,20 +1034,18 @@ udev. %if 0%{?fedora} || 0%{?rhel} >= 8 %patch52 -p1 -b .unbundle-zlib %endif -%patch55 -p1 -b .protobuf-export +# %%patch55 -p1 -b .protobuf-export %patch56 -p1 -b .missing-cstdint %patch57 -p1 -b .missing-cstring %patch58 -p1 -b .ffmpeg-deprecations %patch59 -p1 -b .VirtualCursor-std-layout -%patch60 -p1 -b .ContentRendererType-client +%patch60 -p1 -b .AdjustMaskLayerGeometry-ceilf %if ! 0%{?bundleminizip} %patch61 -p1 -b .system-minizip %endif +%patch62 -p1 -b .update-wayland-client-core -%patch62 -p1 -b .arm-neon-fix - -%patch63 -p1 -b .gcc-cfi-fix %patch64 -p1 -b .aarch64-cxxflags-addition %patch65 -p1 -b .java-only-allowed %patch66 -p1 -b .python3-do-not-use-deprecated-mode-U @@ -1047,6 +1053,10 @@ udev. %patch68 -p1 -b .i686-textrels %patch69 -p1 -b .update-rjsmin-to-1.2.0 %patch70 -p1 -b .update-six-to-1.16.0 +%patch71 -p1 -b .Bitmap-include +%patch72 -p1 -b .browser_finder-include +%patch73 -p1 -b .raw_ptr-noexcept +%patch74 -p1 -b .Trap-raw_ptr %patch79 -p1 -b .widevine-no-download %patch80 -p1 -b .EnumTable-crash # %%patch81 -p1 -b .gcc12fix @@ -1291,7 +1301,6 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'base/third_party/double_conversion' \ 'base/third_party/dynamic_annotations' \ 'base/third_party/icu' \ - 'base/third_party/libevent' \ 'base/third_party/nspr' \ 'base/third_party/superfasthash' \ 'base/third_party/symbolize' \ @@ -1344,6 +1353,7 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/ced' \ 'third_party/cld_3' \ 'third_party/closure_compiler' \ + 'third_party/content_analysis_sdk' \ 'third_party/cpuinfo' \ 'third_party/crashpad' \ 'third_party/crashpad/crashpad/third_party/lss' \ @@ -1415,6 +1425,7 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/libaom/source/libaom/third_party/x86inc' \ 'third_party/libavif' \ 'third_party/libdrm' \ + 'third_party/libevent' \ 'third_party/libgav1' \ 'third_party/libgifcodec' \ 'third_party/libjingle' \ @@ -1472,7 +1483,7 @@ build/linux/unbundle/remove_bundled_libraries.py \ 'third_party/pdfium/third_party/bigint' \ 'third_party/pdfium/third_party/freetype' \ 'third_party/pdfium/third_party/lcms' \ - 'third_party/pdfium/third_party/libopenjpeg20' \ + 'third_party/pdfium/third_party/libopenjpeg' \ 'third_party/pdfium/third_party/libpng16' \ 'third_party/pdfium/third_party/libtiff' \ 'third_party/pdfium/third_party/skia_shared' \ @@ -2197,6 +2208,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Thu Sep 1 2022 Tom Callaway - 105.0.5195.52-1 +- update to 105.0.5195.52 + * Thu Aug 18 2022 Tom Callaway - 104.0.5112.101-1 - update to 104.0.5112.101 diff --git a/sources b/sources index 0a9637d..0d4c4df 100644 --- a/sources +++ b/sources @@ -21,4 +21,4 @@ SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1d SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a SHA512 (node-v12.22.6-linux-arm64.tar.xz) = 87ce5eb954deb1d0debe6fa02b28a3cc675e12fca1e51d44b123ab294aa39ce0c6b8ac9eae1e7a6e32673ea2c2d480651d9ba7eea73012f0529503eebe9eb34d SHA512 (node-v12.22.6-linux-x64.tar.xz) = e1b55c32343cb2ccc40d888c705414bebf9c46b02083d13731df79b1e79521b7277761f6bcca041e40e3a2e47c67bb8e7848aa2b919a9de5c2ebf62c4a9c7176 -SHA512 (chromium-104.0.5112.101-clean.tar.xz) = 280c88c3b8a14acae8187835ffddfad3f76f6b53fd9a33e39a7c980f29d898250647f922242a41cbb9fdac7c54b2f4e181a9520adc9b7f1b40aac4e0b57be9a0 +SHA512 (chromium-105.0.5195.52-clean.tar.xz) = bc71fc13ec929332dad84e28ec6cdd107d675d58435d7a2665970347dd0da87ed0b2861c7975daff2e02e8362ad6d93aa5e30b2b69df4fe0cd3464722b291e05 From 6032343ca55ed455cb92a3f1a16bff4a2efc6721 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Tue, 20 Sep 2022 11:58:27 -0400 Subject: [PATCH 115/659] update to 105.0.5195.125 --- chromium.spec | 5 ++++- sources | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/chromium.spec b/chromium.spec index d591fe0..d9f1a54 100644 --- a/chromium.spec +++ b/chromium.spec @@ -227,7 +227,7 @@ Name: chromium%{chromium_channel}%{nsuffix} %else Name: chromium%{chromium_channel} %endif -Version: %{majorversion}.0.5195.52 +Version: %{majorversion}.0.5195.125 Release: 1%{?dist} %if %{?freeworld} %if %{?shared} @@ -2208,6 +2208,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Mon Sep 19 2022 Tom Callaway - 105.0.5195.125-1 +- update to 105.0.5195.125 + * Thu Sep 1 2022 Tom Callaway - 105.0.5195.52-1 - update to 105.0.5195.52 diff --git a/sources b/sources index 0d4c4df..215065b 100644 --- a/sources +++ b/sources @@ -21,4 +21,4 @@ SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1d SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a SHA512 (node-v12.22.6-linux-arm64.tar.xz) = 87ce5eb954deb1d0debe6fa02b28a3cc675e12fca1e51d44b123ab294aa39ce0c6b8ac9eae1e7a6e32673ea2c2d480651d9ba7eea73012f0529503eebe9eb34d SHA512 (node-v12.22.6-linux-x64.tar.xz) = e1b55c32343cb2ccc40d888c705414bebf9c46b02083d13731df79b1e79521b7277761f6bcca041e40e3a2e47c67bb8e7848aa2b919a9de5c2ebf62c4a9c7176 -SHA512 (chromium-105.0.5195.52-clean.tar.xz) = bc71fc13ec929332dad84e28ec6cdd107d675d58435d7a2665970347dd0da87ed0b2861c7975daff2e02e8362ad6d93aa5e30b2b69df4fe0cd3464722b291e05 +SHA512 (chromium-105.0.5195.125-clean.tar.xz) = da92b1c83bee60ab5e3f7cb45ca4ed0290bc802cb641d642004d79384ecb833bc6472356cf4a19f9e3f052e780ebf389c4307396f29825eed9d2cdb2e368a6ba From 717a675e0fc20d235aa347dc0bc182709ef4e926 Mon Sep 17 00:00:00 2001 From: spotrh Date: Tue, 20 Sep 2022 16:24:01 -0400 Subject: [PATCH 116/659] fix aarch64 builds so they do not try to use clang only flag --- chromium-105.0.5195.125-arm64-gcc-fix.patch | 12 ++++++++++++ chromium.spec | 4 ++++ 2 files changed, 16 insertions(+) create mode 100644 chromium-105.0.5195.125-arm64-gcc-fix.patch diff --git a/chromium-105.0.5195.125-arm64-gcc-fix.patch b/chromium-105.0.5195.125-arm64-gcc-fix.patch new file mode 100644 index 0000000..d9ad16a --- /dev/null +++ b/chromium-105.0.5195.125-arm64-gcc-fix.patch @@ -0,0 +1,12 @@ +diff -up chromium-105.0.5195.125/v8/BUILD.gn.arm64-gcc-fix chromium-105.0.5195.125/v8/BUILD.gn +--- chromium-105.0.5195.125/v8/BUILD.gn.arm64-gcc-fix 2022-09-20 18:12:30.766293126 +0000 ++++ chromium-105.0.5195.125/v8/BUILD.gn 2022-09-20 18:13:04.376435347 +0000 +@@ -1095,7 +1095,7 @@ config("toolchain") { + defines += [ "V8_TARGET_ARCH_ARM64" ] + if (current_cpu == "arm64") { + # This will enable PAC+BTI in code generation and static code. +- if (v8_control_flow_integrity && ++ if (v8_control_flow_integrity && is_clang && + (!build_with_chromium || arm_control_flow_integrity == "standard")) { + cflags += [ "-mbranch-protection=standard" ] + asmflags = [ "-mmark-bti-property" ] diff --git a/chromium.spec b/chromium.spec index d9f1a54..07465ac 100644 --- a/chromium.spec +++ b/chromium.spec @@ -350,6 +350,9 @@ Patch86: chromium-94.0.4606.81-clang-format.patch # This is only in Fedora 37+ Patch87: chromium-99.0.4844.84-markdownsafe-soft_str.patch +# There is a corner case where v8 tries to pass a clang only flag without checking is_clang +Patch88: chromium-105.0.5195.125-arm64-gcc-fix.patch + # Fix extra qualification error Patch97: chromium-103.0.5060.53-remoting-extra-qualification.patch # From gentoo @@ -1066,6 +1069,7 @@ udev. %if 0%{?fedora} >= 37 %patch87 -p1 -b .markdownsafe-soft_str %endif +%patch88 -p1 -b .arm64-gcc-fix %patch97 -p1 -b .remoting-extra-qualification %patch98 -p1 -b .InkDropHost-crash %patch99 -p1 -b .enable-WebRTCPipeWireCapturer-byDefault From 8e69b8771b77afb7ca109ea32cf5fd71a55ad039 Mon Sep 17 00:00:00 2001 From: spotrh Date: Thu, 22 Sep 2022 14:16:05 -0400 Subject: [PATCH 117/659] update node builds for epel --- .gitignore | 2 ++ chromium.spec | 4 ++-- sources | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index fb9b0a1..5cc301e 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,5 @@ /NotoSansTibetan-Regular.ttf /node-v12.22.6-linux-arm64.tar.xz /node-v12.22.6-linux-x64.tar.xz +/node-v16.17.0-linux-x64.tar.xz +/node-v16.17.0-linux-arm64.tar.xz diff --git a/chromium.spec b/chromium.spec index 07465ac..ad22703 100644 --- a/chromium.spec +++ b/chromium.spec @@ -440,8 +440,8 @@ Source17: GardinerModBug.ttf Source18: GardinerModCat.ttf # RHEL 7|8 needs newer nodejs %if 0%{?rhel} && 0%{?rhel} <= 8 -Source19: https://nodejs.org/dist/latest-v12.x/node-v12.22.6-linux-x64.tar.xz -Source21: https://nodejs.org/dist/latest-v12.x/node-v12.22.6-linux-arm64.tar.xz +Source19: https://nodejs.org/dist/latest-v16.x/node-v16.17.0-linux-x64.tar.xz +Source21: https://nodejs.org/dist/latest-v16.x/node-v16.17.0-linux-arm64.tar.xz %endif # Bring xcb-proto with us (might need more than python on EPEL?) Source20: https://www.x.org/releases/individual/proto/xcb-proto-1.14.tar.xz diff --git a/sources b/sources index 215065b..01b6192 100644 --- a/sources +++ b/sources @@ -19,6 +19,6 @@ SHA512 (xcb-proto-1.14.tar.xz) = de66d568163b6da2be9d6c59984f3afa3acd119a7813786 SHA512 (depot_tools.git-master.tar.gz) = dc323888812b66cc92c53a24a8a58ccf9e2961be67aa21852bd091b8b49569071f06ae9104cb58950e6253ac3a29f0db0663e9f35ef2b1ea28696efb38b42708 SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1dc09f5a0fd7898e9d0a372ee4422b6b1cdab3c86ecc91db437e9ae8a951e64e85edc3ac9e9fca428852dbb2ad SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a -SHA512 (node-v12.22.6-linux-arm64.tar.xz) = 87ce5eb954deb1d0debe6fa02b28a3cc675e12fca1e51d44b123ab294aa39ce0c6b8ac9eae1e7a6e32673ea2c2d480651d9ba7eea73012f0529503eebe9eb34d -SHA512 (node-v12.22.6-linux-x64.tar.xz) = e1b55c32343cb2ccc40d888c705414bebf9c46b02083d13731df79b1e79521b7277761f6bcca041e40e3a2e47c67bb8e7848aa2b919a9de5c2ebf62c4a9c7176 SHA512 (chromium-105.0.5195.125-clean.tar.xz) = da92b1c83bee60ab5e3f7cb45ca4ed0290bc802cb641d642004d79384ecb833bc6472356cf4a19f9e3f052e780ebf389c4307396f29825eed9d2cdb2e368a6ba +SHA512 (node-v16.17.0-linux-x64.tar.xz) = aedfeeb71420a7fbcb07fbc4c5d2ba74ffe4f88c15998809346a84148132ec866dbae4e848531a2a77ca41413f442e1046f981d4f188bdf667faf88069aa28cd +SHA512 (node-v16.17.0-linux-arm64.tar.xz) = ae4aabc2389779c9e1b4a15622cae3ba50e0c313ca3d7a1dc7b2344df06ade1f303d6a75b941d37e2a0ef368cf047c862a822a893684494f55446afd6ab0610e From 16836d754460463bac5a6f845889fb5d0aba2cad Mon Sep 17 00:00:00 2001 From: spotrh Date: Thu, 22 Sep 2022 15:22:24 -0400 Subject: [PATCH 118/659] fix hardcoded node ver --- chromium.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chromium.spec b/chromium.spec index ad22703..2346f32 100644 --- a/chromium.spec +++ b/chromium.spec @@ -1283,11 +1283,11 @@ export CHROMIUM_HEADLESS_GN_DEFINES pushd third_party/node/linux %ifarch x86_64 tar xf %{SOURCE19} -mv node-v12.22.6-linux-x64 node-linux-x64 +mv node-v16.17.0-linux-x64 node-linux-x64 %endif %ifarch aarch64 tar xf %{SOURCE21} -mv node-v12.22.6-linux-arm64 node-linux-arm64 +mv node-v16.17.0-linux-arm64 node-linux-arm64 # This is weird, but whatever ln -s node-linux-arm64 node-linux-x64 %endif From cc370311a741a7c3e932598136746a86262d2af8 Mon Sep 17 00:00:00 2001 From: spotrh Date: Fri, 23 Sep 2022 14:35:09 -0400 Subject: [PATCH 119/659] apply upstream fix for wayland menu misplacement bug --- ...mium-105.0.5195.125-fix-wayland-menu.patch | 26 +++++++++++++++++++ chromium.spec | 10 ++++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 chromium-105.0.5195.125-fix-wayland-menu.patch diff --git a/chromium-105.0.5195.125-fix-wayland-menu.patch b/chromium-105.0.5195.125-fix-wayland-menu.patch new file mode 100644 index 0000000..a4ce851 --- /dev/null +++ b/chromium-105.0.5195.125-fix-wayland-menu.patch @@ -0,0 +1,26 @@ +diff -up chromium-105.0.5195.125/ui/ozone/platform/wayland/host/wayland_window.cc.fix-wayland-menu chromium-105.0.5195.125/ui/ozone/platform/wayland/host/wayland_window.cc +--- chromium-105.0.5195.125/ui/ozone/platform/wayland/host/wayland_window.cc.fix-wayland-menu 2022-09-23 18:29:51.872286569 +0000 ++++ chromium-105.0.5195.125/ui/ozone/platform/wayland/host/wayland_window.cc 2022-09-23 18:30:18.819376074 +0000 +@@ -950,7 +950,7 @@ void WaylandWindow::ProcessPendingBounds + // window has been applied. + SetWindowGeometry(pending_bounds_dip_); + AckConfigure(serial); +- root_surface()->Commit(); ++ connection()->ScheduleFlush(); + } else if (!pending_configures_.empty() && + pending_bounds_dip_.size() == + pending_configures_.back().bounds_dip.size()) { +diff -up chromium-105.0.5195.125/ui/ozone/platform/wayland/wayland_buffer_manager_unittest.cc.fix-wayland-menu chromium-105.0.5195.125/ui/ozone/platform/wayland/wayland_buffer_manager_unittest.cc +--- chromium-105.0.5195.125/ui/ozone/platform/wayland/wayland_buffer_manager_unittest.cc.fix-wayland-menu 2022-09-23 18:30:41.936594397 +0000 ++++ chromium-105.0.5195.125/ui/ozone/platform/wayland/wayland_buffer_manager_unittest.cc 2022-09-23 18:31:31.703911576 +0000 +@@ -1103,9 +1103,7 @@ TEST_P(WaylandBufferManagerTest, TestCom + EXPECT_CALL(*xdg_surface, AckConfigure(_)).Times(1); + EXPECT_CALL(*mock_surface, Attach(_, _, _)).Times(1); + EXPECT_CALL(*mock_surface, Frame(_)).Times(1); +- // Commit() can be called a second time as part of the configure -> ack +- // sequence. +- EXPECT_CALL(*mock_surface, Commit()).Times(testing::Between(1, 2)); ++ EXPECT_CALL(*mock_surface, Commit()).Times(1); + + ActivateSurface(mock_surface->xdg_surface()); + Sync(); diff --git a/chromium.spec b/chromium.spec index 2346f32..85390ec 100644 --- a/chromium.spec +++ b/chromium.spec @@ -228,7 +228,7 @@ Name: chromium%{chromium_channel}%{nsuffix} Name: chromium%{chromium_channel} %endif Version: %{majorversion}.0.5195.125 -Release: 1%{?dist} +Release: 2%{?dist} %if %{?freeworld} %if %{?shared} # chromium-libs-media-freeworld @@ -338,6 +338,10 @@ Patch81: chromium-98.0.4758.102-gcc-12-subzero-fix.patch # Disable tests on remoting build Patch82: chromium-98.0.4758.102-remoting-no-tests.patch +# Fix Wayland menu issue +# https://bugs.chromium.org/p/chromium/issues/detail?id=13506 +# https://chromium-review.googlesource.com/c/chromium/src/+/3831855 +Patch83: chromium-105.0.5195.125-fix-wayland-menu.patch # Add missing cmath header Patch84: chromium-94.0.4606.71-remoting-missing-cmath-header.patch @@ -1064,6 +1068,7 @@ udev. %patch80 -p1 -b .EnumTable-crash # %%patch81 -p1 -b .gcc12fix %patch82 -p1 -b .remoting-no-tests +%patch83 -p1 -b .fix-wayland-menu %patch84 -p1 -b .remoting-missing-cmath-header %patch86 -p1 -b .clang-format-py3 %if 0%{?fedora} >= 37 @@ -2212,6 +2217,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt %changelog +* Fri Sep 23 2022 Tom Callaway - 105.0.5195.125-2 +- apply upstream fix for wayland menu misplacement bug + * Mon Sep 19 2022 Tom Callaway - 105.0.5195.125-1 - update to 105.0.5195.125 From 758c7e4887a483abebc93f3da6df0ed118790a2e Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Mon, 21 Nov 2022 11:35:55 +0100 Subject: [PATCH 120/659] update to 107.0.5304.110 --- ...0470cdb0bea4548a0f5e8271b359f9450c79.patch | 567 - ...-100-GLImplementationParts-constexpr.patch | 92 - chromium-100-InMilliseconds-constexpr.patch | 97 - chromium-100-SCTHashdanceMetadata-move.patch | 35 - chromium-100-macro-typo.patch | 29 - ....60-missing-utility-for-std-exchange.patch | 12 - ...-100.0.4896.75-missing-include-tuple.patch | 11 - ...100.0.4896.75-missing-include-vector.patch | 11 - chromium-100.0.4896.75-old-xkb.patch | 49 - ...4896.75-remoting-extra-qualification.patch | 147 - ...4951.41-remoting-extra-qualification.patch | 165 - chromium-102-fenced_frame_utils-include.patch | 25 - chromium-102-regex_pattern-array.patch | 14 - ...2-swiftshader-template-instantiation.patch | 47 - chromium-102-symbolize-include.patch | 43 - chromium-103-FrameLoadRequest-type.patch | 26 - chromium-103-SubstringSetMatcher-packed.patch | 70 - ...python3-do-not-use-deprecated-mode-U.patch | 12 - ...0.5112.101-system-minizip-header-fix.patch | 76 - ...um-105-AdjustMaskLayerGeometry-ceilf.patch | 41 - chromium-105-Bitmap-include.patch | 26 - chromium-105-Trap-raw_ptr.patch | 161 - chromium-105-browser_finder-include.patch | 24 - chromium-105-raw_ptr-noexcept.patch | 30 - ...mium-105.0.5195.125-fix-wayland-menu.patch | 26 - chromium-105.0.5195.52-gn-system.patch | 207 - ...0.5304.101-system-minizip-header-fix.patch | 65 + chromium-107.0.5304.110-gn-system.patch | 39 + ...304.110-remoting-extra-qualification.patch | 72 +- ...998819088f76b4cf44c8db6940240c563cf4.patch | 19 - chromium-60.0.3112.78-jpeg-nomangle.patch | 14 - ...mium-68.0.3440.106-master-prefs-path.patch | 15 - ...38.67-disable-fontconfig-cache-magic.patch | 13 - chromium-73.0.3683.75-norar.patch | 81 - chromium-75.0.3770.100-epel7-stdc++.patch | 11 - ...-75.0.3770.80-vaapi-i686-fpermissive.patch | 23 - ...0.3809.100-gcc-no-alignas-and-export.patch | 14 - ...76.0.3809.100-gcc-remoting-constexpr.patch | 27 - ...6.0.3809.100-vtable-symbol-undefined.patch | 11 - ...-76.0.3809.132-chromedriver-zlib-fix.patch | 11 - chromium-77-clang.patch | 13 - ...ium-77.0.3865.75-base-gcc-no-alignas.patch | 12 - ...7.0.3865.75-certificate-transparency.patch | 539 - ...mium-77.0.3865.75-gcc-abstract-class.patch | 61 - chromium-77.0.3865.75-harfbuzz-subset.patch | 49 - chromium-77.0.3865.75-missing-limits.patch | 28 - chromium-77.0.3865.75-unbundle-zlib.patch | 25 - chromium-77.0.3865.90-linked-hash-set.patch | 130 - ...-78-protobuf-RepeatedPtrField-export.patch | 13 - ...m-78.0.3904.70-gcc9-drop-rsp-clobber.patch | 24 - chromium-78.0.3904.70-unbundle-zlib.patch | 12 - ...78.0.3904.70-vtable-symbol-undefined.patch | 11 - chromium-79-gcc-ambiguous-nodestructor.patch | 39 - chromium-79-gcc-permissive.patch | 79 - chromium-79-include.patch | 131 - ...c++17-to-work-around-ugly-angle-code.patch | 28 - chromium-79.0.3945.56-fedora-user-agent.patch | 12 - chromium-79.0.3945.56-fix-find_if.patch | 11 - chromium-79.0.3945.56-gcc-name-clash.patch | 108 - ...m-79.0.3945.56-glibc-clock-nanosleep.patch | 52 - ...9.0.3945.56-widevine-other-locations.patch | 19 - chromium-80-gcc-blink.patch | 45 - ...80.0.3987.106-missing-cstddef-header.patch | 44 - ...80.0.3987.122-vaapi-i686-fpermissive.patch | 23 - chromium-80.0.3987.132-el7-noexcept.patch | 201 - chromium-80.0.3987.87-fix-for-c++17.patch | 190 - chromium-80.0.3987.87-libpipewire-0.3.patch | 12 - ...-80.0.3987.87-missing-cstddef-header.patch | 22 - ...-80.0.3987.87-missing-cstdint-header.patch | 45 - ...m-80.0.3987.87-missing-string-header.patch | 11 - chromium-81-gcc-constexpr.patch | 19 - chromium-81-gcc-noexcept.patch | 13 - chromium-81-vaapi-r737459.patch | 52 - chromium-81-vaapi-r738595.patch | 31 - ...44.92-disable-fontconfig-cache-magic.patch | 13 - ...mium-81.0.4044.92-fix-vaapi-on-intel.patch | 36 - ...m-81.0.4044.92-missing-memory-header.patch | 11 - chromium-81.0.4044.92-norar.patch | 79 - ...83-WebUI-fix-template-specialization.patch | 67 - chromium-83-gcc-compatibility.patch | 25 - chromium-83-gcc-iterator.patch | 41 - chromium-83-gcc-ozone-wayland.patch | 12 - ...03.61-disable-fontconfig-cache-magic.patch | 13 - ...-83.0.4103.61-missing-cstddef-header.patch | 34 - chromium-83.0.4103.61-norar.patch | 79 - ...0.4103.97-skia-gcc-no_sanitize-fixes.patch | 48 - ...-83.0.4103.97-vaapi-i686-fpermissive.patch | 23 - chromium-84-AXObject-stl-iterator.patch | 36 - chromium-84-FilePath-add-noexcept.patch | 55 - ...-ListContainerHelper-include-cstring.patch | 30 - ...ionTrait-fix-template-specialization.patch | 114 - ...orBuffer-fix-template-specialization.patch | 34 - chromium-84-base-has_bultin.patch | 87 - chromium-84-blink-disable-clang-format.patch | 33 - chromium-84-crashpad-include-cstring.patch | 90 - ...ss_variant_mojo_util-remove-noexcept.patch | 37 - chromium-84-fix-decltype.patch | 65 - ...m-84-flat_map-flat_tree-add-noexcept.patch | 66 - chromium-84-gcc-DCHECK_EQ-unique_ptr.patch | 29 - chromium-84-gcc-DOMRect-constexpr.patch | 29 - chromium-84-gcc-use-brace-initializer.patch | 39 - ...age-ManifestManagerHost-per-document.patch | 391 - chromium-84-std-vector-const.patch | 49 - chromium-84.0.4147.105-gn-gcc-cleanup.patch | 45 - ...ch64-clearkeycdm-binutils-workaround.patch | 13 - chromium-84.0.4147.125-remoting-cstring.patch | 56 - chromium-84.0.4147.89-el-constexpr.patch | 13 - ....0.4147.89-el8-arm-incompatible-ints.patch | 192 - chromium-84.0.4147.89-epel7-no-kcmp-h.patch | 14 - chromium-84.0.4147.89-epel7-old-cups.patch | 149 - ...mium-84.0.4147.89-fix-vaapi-on-intel.patch | 36 - chromium-84.0.4147.89-nss3.patch | 12 - chromium-85-DelayNode-cast.patch | 31 - chromium-85-FrameWidget-namespace.patch | 34 - chromium-85-NearbyConnection-abstract.patch | 29 - ...rbyShareEncryptedMetadataKey-include.patch | 25 - chromium-85-oscillator_node-cast.patch | 34 - chromium-85-ostream-operator.patch | 52 - chromium-85-ozone-include.patch | 24 - chromium-85-sim_hash-include.patch | 25 - chromium-85.0.4183.83-gcc-not-auto.patch | 22 - ...75-enable-hardware-accelerated-mjpeg.patch | 71 - chromium-86.0.4240.75-fedora-user-agent.patch | 12 - ...-86.0.4240.75-initial_prefs-etc-path.patch | 15 - chromium-86.0.4240.75-norar.patch | 90 - chromium-87-CursorFactory-include.patch | 36 - ...-87-ServiceWorkerContainerHost-crash.patch | 22 - chromium-87-openscreen-include.patch | 25 - chromium-87.0.4280.66-el7-no-sys-random.patch | 13 - ...-dns_server_iterator-missing-cstddef.patch | 11 - ...280.88-floc_constants-missing-limits.patch | 11 - chromium-88-AXTreeFormatter-include.patch | 27 - ...ium-88-BookmarkModelObserver-include.patch | 21 - ...um-88-CompositorFrameReporter-dcheck.patch | 36 - chromium-88-StringPool-include.patch | 20 - chromium-88-dawn-static.patch | 59 - chromium-88-federated_learning-include.patch | 21 - chromium-88-ityp-include.patch | 25 - chromium-88-vaapi-attribute.patch | 39 - chromium-88.0.4324.11-norar.patch | 90 - ...8.0.4324.182-rawhide-gcc-std-max-fix.patch | 24 - ...hel8-force-disable-use_gnome_keyring.patch | 10 - chromium-89-AXTreeSerializer-include.patch | 25 - chromium-89-EnumTable-crash.patch | 71 - chromium-89-dawn-include.patch | 28 - chromium-89-quiche-dcheck.patch | 29 - chromium-89-quiche-private.patch | 26 - chromium-89-skia-CropRect.patch | 38 - ...72-enable-hardware-accelerated-mjpeg.patch | 66 - ...-89.0.4389.72-initial_prefs-etc-path.patch | 15 - ...-89.0.4389.72-missing-cstring-header.patch | 34 - chromium-89.0.4389.72-norar.patch | 90 - ...9.0.4389.72-widevine-other-locations.patch | 20 - ...hel8-force-disable-use_gnome_keyring.patch | 10 - ...um-89.0.4389.82-support-futex_time64.patch | 29 - ...m-90-CrossThreadCopier-qualification.patch | 29 - chromium-90-TokenizedOutput-include.patch | 24 - chromium-90-angle-constexpr.patch | 28 - chromium-90-quantization_utils-include.patch | 24 - chromium-90-ruy-include.patch | 24 - chromium-90.0.4430.72-fstatfix.patch | 141 - ...um-90.0.4430.72-widevine-no-download.patch | 14 - chromium-90.0.4430.93-epel7-erase-fix.patch | 20 - ...430.93-epel7-old-headers-workarounds.patch | 127 - chromium-91-1190561-boo1186948.patch | 45 - chromium-91-libyuv-aarch64.patch | 91 - chromium-91-pcscan-vector-types.patch | 47 - chromium-91.0.4472.114-epel7-erase-fix.patch | 20 - ...72.77-disable-fontconfig-cache-magic.patch | 13 - ...m-91.0.4472.77-update-highway-0.12.2.patch | 12203 ---------------- chromium-92-clang-format.patch | 25 - chromium-92-v8-constexpr.patch | 17 - chromium-92.0.4515.107-EnumTable-crash.patch | 70 - chromium-92.0.4515.107-gn-gcc-cleanup.patch | 45 - chromium-92.0.4515.107-norar.patch | 90 - chromium-92.0.4515.107-py3-bootstrap.patch | 24 - chromium-92.0.4515.107-py3-fixes.patch | 17 - ...2.0.4515.107-rawhide-gcc-std-max-fix.patch | 13 - ...hel8-force-disable-use_gnome_keyring.patch | 12 - chromium-92.0.4515.107-sandbox-clone3.patch | 16 - ...-92.0.4515.107-update-highway-0.12.2.patch | 4199 ------ ....0.4515.107-widevine-other-locations.patch | 20 - ...BluetoothLowEnergyScanFilter-include.patch | 30 - chromium-93-ClassProperty-include.patch | 30 - chromium-93-ContextSet-permissive.patch | 47 - ...olsEmbedderMessageDispatcher-include.patch | 24 - chromium-93-FormForest-constexpr.patch | 49 - chromium-93-HashPasswordManager-include.patch | 30 - ...-ScopedTestDialogAutoConfirm-include.patch | 24 - chromium-93-pdfium-include.patch | 117 - chromium-93.0.4577.63-clang-format.patch | 34 - chromium-93.0.4577.63-freetype-2.11.patch | 52 - chromium-93.0.4577.63-missing-cstring.patch | 45 - chromium-93.0.4577.63-mojo-header-fix.patch | 12 - chromium-93.0.4577.63-norar.patch | 90 - ....0.4577.63-remoting-nodestructor-fix.patch | 21 - chromium-93.0.4577.63-vector-fix.patch | 11 - ...um-93.0.4577.63-widevine-no-download.patch | 14 - chromium-93.0.4577.82-harfbuzz3.patch | 97 - chromium-94-ConversionStorageSql-lambda.patch | 31 - chromium-94-CustomSpaces-include.patch | 24 - ...m-94.0.4606.54-gcc9-drop-rsp-clobber.patch | 12 - ....0.4606.54-remoting-nodestructor-fix.patch | 22 - ...webrtc-BUILD.gn-fix-multiple-defines.patch | 16 - ...4606.61-remoting-extra-qualification.patch | 12 - ....0.4606.71-PartitionFree-nullptr-fix.patch | 15 - ...606.81-i686-low-memory-linking-hacks.patch | 13 - chromium-95-BitstreamReader-namespace.patch | 41 - chromium-95-eigen-avx-1.patch | 229 - chromium-95-eigen-avx-2.patch | 30 - chromium-95-eigen-avx-3.patch | 44 - chromium-95-libyuv-aarch64.patch | 30 - chromium-95-libyuv-arm.patch | 13 - chromium-95-maldoca-zlib.patch | 13 - chromium-95-quiche-include.patch | 25 - chromium-95-xfce-maximize.patch | 30 - chromium-95.0.4638.69-missing-cstring.patch | 57 - chromium-96-CommandLine-include.patch | 24 - chromium-96-CouponDB-include.patch | 25 - ...m-96-DrmRenderNodePathFinder-include.patch | 24 - chromium-96-EnumTable-crash.patch | 76 - ...ium-96-RestrictedCookieManager-tuple.patch | 31 - chromium-96-xfce-maximize.patch | 51 - ...4.45-no-const-elements-in-std-vector.patch | 17 - chromium-98-MiraclePtr-gcc-ice.patch | 91 - chromium-98-WaylandFrameManager-check.patch | 27 - ...ium-98.0.4758.102-gcc-12-subzero-fix.patch | 69 - ...um-98.0.4758.80-el7-extra-operator==.patch | 15 - ...80-enable-hardware-accelerated-mjpeg.patch | 62 - chromium-98.0.4758.80-epel7-old-cups.patch | 167 - ...758.80-epel7-old-headers-workarounds.patch | 127 - chromium-98.0.4758.80-fedora-user-agent.patch | 12 - ....80-missing-utility-for-std-exchange.patch | 23 - ...4758.80-remoting-extra-qualification.patch | 84 - ...lAssistantModelExecutor-NoDestructor.patch | 32 - chromium-99.0.4844.51-fedora-user-agent.patch | 12 - chromium-blink-gcc-diagnostic-pragma.patch | 32 - chromium-clang_lto_visibility_public.patch | 53 - chromium-fix-char_traits.patch | 14 - chromium-freetype-2.11.patch | 50 - chromium-quiche-invalid-offsetof.patch | 57 - chromium-skia-no_sanitize.patch | 61 - chromium-widevine-other-locations.patch | 23 - chromium.spec | 137 +- ...62edd9b49143b89fc76c4a31dd5603b6fbd0.patch | 712 - enable-vaapi.patch | 96 - 246 files changed, 201 insertions(+), 28977 deletions(-) delete mode 100644 7ae60470cdb0bea4548a0f5e8271b359f9450c79.patch delete mode 100644 chromium-100-GLImplementationParts-constexpr.patch delete mode 100644 chromium-100-InMilliseconds-constexpr.patch delete mode 100644 chromium-100-SCTHashdanceMetadata-move.patch delete mode 100644 chromium-100-macro-typo.patch delete mode 100644 chromium-100.0.4896.60-missing-utility-for-std-exchange.patch delete mode 100644 chromium-100.0.4896.75-missing-include-tuple.patch delete mode 100644 chromium-100.0.4896.75-missing-include-vector.patch delete mode 100644 chromium-100.0.4896.75-old-xkb.patch delete mode 100644 chromium-100.0.4896.75-remoting-extra-qualification.patch delete mode 100644 chromium-101.0.4951.41-remoting-extra-qualification.patch delete mode 100644 chromium-102-fenced_frame_utils-include.patch delete mode 100644 chromium-102-regex_pattern-array.patch delete mode 100644 chromium-102-swiftshader-template-instantiation.patch delete mode 100644 chromium-102-symbolize-include.patch delete mode 100644 chromium-103-FrameLoadRequest-type.patch delete mode 100644 chromium-103-SubstringSetMatcher-packed.patch delete mode 100644 chromium-103.0.5060.53-python3-do-not-use-deprecated-mode-U.patch delete mode 100644 chromium-104.0.5112.101-system-minizip-header-fix.patch delete mode 100644 chromium-105-AdjustMaskLayerGeometry-ceilf.patch delete mode 100644 chromium-105-Bitmap-include.patch delete mode 100644 chromium-105-Trap-raw_ptr.patch delete mode 100644 chromium-105-browser_finder-include.patch delete mode 100644 chromium-105-raw_ptr-noexcept.patch delete mode 100644 chromium-105.0.5195.125-fix-wayland-menu.patch delete mode 100644 chromium-105.0.5195.52-gn-system.patch create mode 100644 chromium-107.0.5304.101-system-minizip-header-fix.patch create mode 100644 chromium-107.0.5304.110-gn-system.patch rename chromium-103.0.5060.53-remoting-extra-qualification.patch => chromium-107.0.5304.110-remoting-extra-qualification.patch (71%) delete mode 100644 chromium-58.0.3029.96-revert-b794998819088f76b4cf44c8db6940240c563cf4.patch delete mode 100644 chromium-60.0.3112.78-jpeg-nomangle.patch delete mode 100644 chromium-68.0.3440.106-master-prefs-path.patch delete mode 100644 chromium-70.0.3538.67-disable-fontconfig-cache-magic.patch delete mode 100644 chromium-73.0.3683.75-norar.patch delete mode 100644 chromium-75.0.3770.100-epel7-stdc++.patch delete mode 100644 chromium-75.0.3770.80-vaapi-i686-fpermissive.patch delete mode 100644 chromium-76.0.3809.100-gcc-no-alignas-and-export.patch delete mode 100644 chromium-76.0.3809.100-gcc-remoting-constexpr.patch delete mode 100644 chromium-76.0.3809.100-vtable-symbol-undefined.patch delete mode 100644 chromium-76.0.3809.132-chromedriver-zlib-fix.patch delete mode 100644 chromium-77-clang.patch delete mode 100644 chromium-77.0.3865.75-base-gcc-no-alignas.patch delete mode 100644 chromium-77.0.3865.75-certificate-transparency.patch delete mode 100644 chromium-77.0.3865.75-gcc-abstract-class.patch delete mode 100644 chromium-77.0.3865.75-harfbuzz-subset.patch delete mode 100644 chromium-77.0.3865.75-missing-limits.patch delete mode 100644 chromium-77.0.3865.75-unbundle-zlib.patch delete mode 100644 chromium-77.0.3865.90-linked-hash-set.patch delete mode 100644 chromium-78-protobuf-RepeatedPtrField-export.patch delete mode 100644 chromium-78.0.3904.70-gcc9-drop-rsp-clobber.patch delete mode 100644 chromium-78.0.3904.70-unbundle-zlib.patch delete mode 100644 chromium-78.0.3904.70-vtable-symbol-undefined.patch delete mode 100644 chromium-79-gcc-ambiguous-nodestructor.patch delete mode 100644 chromium-79-gcc-permissive.patch delete mode 100644 chromium-79-include.patch delete mode 100644 chromium-79.0.3945.130-gcc10-use-c++17-to-work-around-ugly-angle-code.patch delete mode 100644 chromium-79.0.3945.56-fedora-user-agent.patch delete mode 100644 chromium-79.0.3945.56-fix-find_if.patch delete mode 100644 chromium-79.0.3945.56-gcc-name-clash.patch delete mode 100644 chromium-79.0.3945.56-glibc-clock-nanosleep.patch delete mode 100644 chromium-79.0.3945.56-widevine-other-locations.patch delete mode 100644 chromium-80-gcc-blink.patch delete mode 100644 chromium-80.0.3987.106-missing-cstddef-header.patch delete mode 100644 chromium-80.0.3987.122-vaapi-i686-fpermissive.patch delete mode 100644 chromium-80.0.3987.132-el7-noexcept.patch delete mode 100644 chromium-80.0.3987.87-fix-for-c++17.patch delete mode 100644 chromium-80.0.3987.87-libpipewire-0.3.patch delete mode 100644 chromium-80.0.3987.87-missing-cstddef-header.patch delete mode 100644 chromium-80.0.3987.87-missing-cstdint-header.patch delete mode 100644 chromium-80.0.3987.87-missing-string-header.patch delete mode 100644 chromium-81-gcc-constexpr.patch delete mode 100644 chromium-81-gcc-noexcept.patch delete mode 100644 chromium-81-vaapi-r737459.patch delete mode 100644 chromium-81-vaapi-r738595.patch delete mode 100644 chromium-81.0.4044.92-disable-fontconfig-cache-magic.patch delete mode 100644 chromium-81.0.4044.92-fix-vaapi-on-intel.patch delete mode 100644 chromium-81.0.4044.92-missing-memory-header.patch delete mode 100644 chromium-81.0.4044.92-norar.patch delete mode 100644 chromium-83-WebUI-fix-template-specialization.patch delete mode 100644 chromium-83-gcc-compatibility.patch delete mode 100644 chromium-83-gcc-iterator.patch delete mode 100644 chromium-83-gcc-ozone-wayland.patch delete mode 100644 chromium-83.0.4103.61-disable-fontconfig-cache-magic.patch delete mode 100644 chromium-83.0.4103.61-missing-cstddef-header.patch delete mode 100644 chromium-83.0.4103.61-norar.patch delete mode 100644 chromium-83.0.4103.97-skia-gcc-no_sanitize-fixes.patch delete mode 100644 chromium-83.0.4103.97-vaapi-i686-fpermissive.patch delete mode 100644 chromium-84-AXObject-stl-iterator.patch delete mode 100644 chromium-84-FilePath-add-noexcept.patch delete mode 100644 chromium-84-ListContainerHelper-include-cstring.patch delete mode 100644 chromium-84-TraceInCollectionTrait-fix-template-specialization.patch delete mode 100644 chromium-84-VectorBuffer-fix-template-specialization.patch delete mode 100644 chromium-84-base-has_bultin.patch delete mode 100644 chromium-84-blink-disable-clang-format.patch delete mode 100644 chromium-84-crashpad-include-cstring.patch delete mode 100644 chromium-84-cross_variant_mojo_util-remove-noexcept.patch delete mode 100644 chromium-84-fix-decltype.patch delete mode 100644 chromium-84-flat_map-flat_tree-add-noexcept.patch delete mode 100644 chromium-84-gcc-DCHECK_EQ-unique_ptr.patch delete mode 100644 chromium-84-gcc-DOMRect-constexpr.patch delete mode 100644 chromium-84-gcc-use-brace-initializer.patch delete mode 100644 chromium-84-revert-manage-ManifestManagerHost-per-document.patch delete mode 100644 chromium-84-std-vector-const.patch delete mode 100644 chromium-84.0.4147.105-gn-gcc-cleanup.patch delete mode 100644 chromium-84.0.4147.125-aarch64-clearkeycdm-binutils-workaround.patch delete mode 100644 chromium-84.0.4147.125-remoting-cstring.patch delete mode 100644 chromium-84.0.4147.89-el-constexpr.patch delete mode 100644 chromium-84.0.4147.89-el8-arm-incompatible-ints.patch delete mode 100644 chromium-84.0.4147.89-epel7-no-kcmp-h.patch delete mode 100644 chromium-84.0.4147.89-epel7-old-cups.patch delete mode 100644 chromium-84.0.4147.89-fix-vaapi-on-intel.patch delete mode 100644 chromium-84.0.4147.89-nss3.patch delete mode 100644 chromium-85-DelayNode-cast.patch delete mode 100644 chromium-85-FrameWidget-namespace.patch delete mode 100644 chromium-85-NearbyConnection-abstract.patch delete mode 100644 chromium-85-NearbyShareEncryptedMetadataKey-include.patch delete mode 100644 chromium-85-oscillator_node-cast.patch delete mode 100644 chromium-85-ostream-operator.patch delete mode 100644 chromium-85-ozone-include.patch delete mode 100644 chromium-85-sim_hash-include.patch delete mode 100644 chromium-85.0.4183.83-gcc-not-auto.patch delete mode 100644 chromium-86.0.4240.75-enable-hardware-accelerated-mjpeg.patch delete mode 100644 chromium-86.0.4240.75-fedora-user-agent.patch delete mode 100644 chromium-86.0.4240.75-initial_prefs-etc-path.patch delete mode 100644 chromium-86.0.4240.75-norar.patch delete mode 100644 chromium-87-CursorFactory-include.patch delete mode 100644 chromium-87-ServiceWorkerContainerHost-crash.patch delete mode 100644 chromium-87-openscreen-include.patch delete mode 100644 chromium-87.0.4280.66-el7-no-sys-random.patch delete mode 100644 chromium-87.0.4280.88-dns_server_iterator-missing-cstddef.patch delete mode 100644 chromium-87.0.4280.88-floc_constants-missing-limits.patch delete mode 100644 chromium-88-AXTreeFormatter-include.patch delete mode 100644 chromium-88-BookmarkModelObserver-include.patch delete mode 100644 chromium-88-CompositorFrameReporter-dcheck.patch delete mode 100644 chromium-88-StringPool-include.patch delete mode 100644 chromium-88-dawn-static.patch delete mode 100644 chromium-88-federated_learning-include.patch delete mode 100644 chromium-88-ityp-include.patch delete mode 100644 chromium-88-vaapi-attribute.patch delete mode 100644 chromium-88.0.4324.11-norar.patch delete mode 100644 chromium-88.0.4324.182-rawhide-gcc-std-max-fix.patch delete mode 100644 chromium-88.0.4324.96-rhel8-force-disable-use_gnome_keyring.patch delete mode 100644 chromium-89-AXTreeSerializer-include.patch delete mode 100644 chromium-89-EnumTable-crash.patch delete mode 100644 chromium-89-dawn-include.patch delete mode 100644 chromium-89-quiche-dcheck.patch delete mode 100644 chromium-89-quiche-private.patch delete mode 100644 chromium-89-skia-CropRect.patch delete mode 100644 chromium-89.0.4389.72-enable-hardware-accelerated-mjpeg.patch delete mode 100644 chromium-89.0.4389.72-initial_prefs-etc-path.patch delete mode 100644 chromium-89.0.4389.72-missing-cstring-header.patch delete mode 100644 chromium-89.0.4389.72-norar.patch delete mode 100644 chromium-89.0.4389.72-widevine-other-locations.patch delete mode 100644 chromium-89.0.4389.82-rhel8-force-disable-use_gnome_keyring.patch delete mode 100644 chromium-89.0.4389.82-support-futex_time64.patch delete mode 100644 chromium-90-CrossThreadCopier-qualification.patch delete mode 100644 chromium-90-TokenizedOutput-include.patch delete mode 100644 chromium-90-angle-constexpr.patch delete mode 100644 chromium-90-quantization_utils-include.patch delete mode 100644 chromium-90-ruy-include.patch delete mode 100644 chromium-90.0.4430.72-fstatfix.patch delete mode 100644 chromium-90.0.4430.72-widevine-no-download.patch delete mode 100644 chromium-90.0.4430.93-epel7-erase-fix.patch delete mode 100644 chromium-90.0.4430.93-epel7-old-headers-workarounds.patch delete mode 100644 chromium-91-1190561-boo1186948.patch delete mode 100644 chromium-91-libyuv-aarch64.patch delete mode 100644 chromium-91-pcscan-vector-types.patch delete mode 100644 chromium-91.0.4472.114-epel7-erase-fix.patch delete mode 100644 chromium-91.0.4472.77-disable-fontconfig-cache-magic.patch delete mode 100644 chromium-91.0.4472.77-update-highway-0.12.2.patch delete mode 100644 chromium-92-clang-format.patch delete mode 100644 chromium-92-v8-constexpr.patch delete mode 100644 chromium-92.0.4515.107-EnumTable-crash.patch delete mode 100644 chromium-92.0.4515.107-gn-gcc-cleanup.patch delete mode 100644 chromium-92.0.4515.107-norar.patch delete mode 100644 chromium-92.0.4515.107-py3-bootstrap.patch delete mode 100644 chromium-92.0.4515.107-py3-fixes.patch delete mode 100644 chromium-92.0.4515.107-rawhide-gcc-std-max-fix.patch delete mode 100644 chromium-92.0.4515.107-rhel8-force-disable-use_gnome_keyring.patch delete mode 100644 chromium-92.0.4515.107-sandbox-clone3.patch delete mode 100644 chromium-92.0.4515.107-update-highway-0.12.2.patch delete mode 100644 chromium-92.0.4515.107-widevine-other-locations.patch delete mode 100644 chromium-93-BluetoothLowEnergyScanFilter-include.patch delete mode 100644 chromium-93-ClassProperty-include.patch delete mode 100644 chromium-93-ContextSet-permissive.patch delete mode 100644 chromium-93-DevToolsEmbedderMessageDispatcher-include.patch delete mode 100644 chromium-93-FormForest-constexpr.patch delete mode 100644 chromium-93-HashPasswordManager-include.patch delete mode 100644 chromium-93-ScopedTestDialogAutoConfirm-include.patch delete mode 100644 chromium-93-pdfium-include.patch delete mode 100644 chromium-93.0.4577.63-clang-format.patch delete mode 100644 chromium-93.0.4577.63-freetype-2.11.patch delete mode 100644 chromium-93.0.4577.63-missing-cstring.patch delete mode 100644 chromium-93.0.4577.63-mojo-header-fix.patch delete mode 100644 chromium-93.0.4577.63-norar.patch delete mode 100644 chromium-93.0.4577.63-remoting-nodestructor-fix.patch delete mode 100644 chromium-93.0.4577.63-vector-fix.patch delete mode 100644 chromium-93.0.4577.63-widevine-no-download.patch delete mode 100644 chromium-93.0.4577.82-harfbuzz3.patch delete mode 100644 chromium-94-ConversionStorageSql-lambda.patch delete mode 100644 chromium-94-CustomSpaces-include.patch delete mode 100644 chromium-94.0.4606.54-gcc9-drop-rsp-clobber.patch delete mode 100644 chromium-94.0.4606.54-remoting-nodestructor-fix.patch delete mode 100644 chromium-94.0.4606.54-webrtc-BUILD.gn-fix-multiple-defines.patch delete mode 100644 chromium-94.0.4606.61-remoting-extra-qualification.patch delete mode 100644 chromium-94.0.4606.71-PartitionFree-nullptr-fix.patch delete mode 100644 chromium-94.0.4606.81-i686-low-memory-linking-hacks.patch delete mode 100644 chromium-95-BitstreamReader-namespace.patch delete mode 100644 chromium-95-eigen-avx-1.patch delete mode 100644 chromium-95-eigen-avx-2.patch delete mode 100644 chromium-95-eigen-avx-3.patch delete mode 100644 chromium-95-libyuv-aarch64.patch delete mode 100644 chromium-95-libyuv-arm.patch delete mode 100644 chromium-95-maldoca-zlib.patch delete mode 100644 chromium-95-quiche-include.patch delete mode 100644 chromium-95-xfce-maximize.patch delete mode 100644 chromium-95.0.4638.69-missing-cstring.patch delete mode 100644 chromium-96-CommandLine-include.patch delete mode 100644 chromium-96-CouponDB-include.patch delete mode 100644 chromium-96-DrmRenderNodePathFinder-include.patch delete mode 100644 chromium-96-EnumTable-crash.patch delete mode 100644 chromium-96-RestrictedCookieManager-tuple.patch delete mode 100644 chromium-96-xfce-maximize.patch delete mode 100644 chromium-96.0.4664.45-no-const-elements-in-std-vector.patch delete mode 100644 chromium-98-MiraclePtr-gcc-ice.patch delete mode 100644 chromium-98-WaylandFrameManager-check.patch delete mode 100644 chromium-98.0.4758.102-gcc-12-subzero-fix.patch delete mode 100644 chromium-98.0.4758.80-el7-extra-operator==.patch delete mode 100644 chromium-98.0.4758.80-enable-hardware-accelerated-mjpeg.patch delete mode 100644 chromium-98.0.4758.80-epel7-old-cups.patch delete mode 100644 chromium-98.0.4758.80-epel7-old-headers-workarounds.patch delete mode 100644 chromium-98.0.4758.80-fedora-user-agent.patch delete mode 100644 chromium-98.0.4758.80-missing-utility-for-std-exchange.patch delete mode 100644 chromium-98.0.4758.80-remoting-extra-qualification.patch delete mode 100644 chromium-99-AutofillAssistantModelExecutor-NoDestructor.patch delete mode 100644 chromium-99.0.4844.51-fedora-user-agent.patch delete mode 100644 chromium-blink-gcc-diagnostic-pragma.patch delete mode 100644 chromium-clang_lto_visibility_public.patch delete mode 100644 chromium-fix-char_traits.patch delete mode 100644 chromium-freetype-2.11.patch delete mode 100644 chromium-quiche-invalid-offsetof.patch delete mode 100644 chromium-skia-no_sanitize.patch delete mode 100644 chromium-widevine-other-locations.patch delete mode 100644 e0b362edd9b49143b89fc76c4a31dd5603b6fbd0.patch delete mode 100644 enable-vaapi.patch diff --git a/7ae60470cdb0bea4548a0f5e8271b359f9450c79.patch b/7ae60470cdb0bea4548a0f5e8271b359f9450c79.patch deleted file mode 100644 index 983c6d1..0000000 --- a/7ae60470cdb0bea4548a0f5e8271b359f9450c79.patch +++ /dev/null @@ -1,567 +0,0 @@ -From 7ae60470cdb0bea4548a0f5e8271b359f9450c79 Mon Sep 17 00:00:00 2001 -From: Jeffrey Kardatzke -Date: Fri, 5 Feb 2021 03:33:58 +0000 -Subject: [PATCH] vaapi: Update for libva forwards compatibility - -There was a downstream patch applied for protected content for libva. -This patch is now upstreamed, but is not compatible with the downstream -version. This change will allow us to update libva in ChromeOS to an -intermediate version that'll be compatible with both downstream and -upstream. Then we can shift Chrome to the upstream API, and then remove -the downstream compatibility layer from ChromeOS after that and be on -upstream. - -BUG=b:174951211 -TEST=Chrome builds, protected content plays back - -Change-Id: Id06b21daf19a54b340236b354b5f4a828e2362de -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2672690 -Reviewed-by: Andres Calderon Jaramillo -Reviewed-by: J Kardatzke -Commit-Queue: J Kardatzke -Cr-Commit-Position: refs/heads/master@{#850949} ---- - .../h264_vaapi_video_decoder_delegate.cc | 7 + - .../vaapi/h265_vaapi_video_decoder_delegate.h | 7 + - media/gpu/vaapi/va_prot.sigs | 1 - - media/gpu/vaapi/vaapi_utils.h | 7 + - .../gpu/vaapi/vaapi_video_decoder_delegate.cc | 11 +- - .../gpu/vaapi/vaapi_video_decoder_delegate.h | 7 + - media/gpu/vaapi/vaapi_wrapper.cc | 30 +-- - media/gpu/vaapi/vaapi_wrapper.h | 7 + - .../va_protected_content.h | 225 ++---------------- - tools/metrics/histograms/enums.xml | 2 +- - 10 files changed, 75 insertions(+), 229 deletions(-) - -diff --git a/media/gpu/vaapi/h264_vaapi_video_decoder_delegate.cc b/media/gpu/vaapi/h264_vaapi_video_decoder_delegate.cc -index 6e82506082ede..22fa594610540 100644 ---- a/media/gpu/vaapi/h264_vaapi_video_decoder_delegate.cc -+++ b/media/gpu/vaapi/h264_vaapi_video_decoder_delegate.cc -@@ -4,6 +4,13 @@ - - #include "media/gpu/vaapi/h264_vaapi_video_decoder_delegate.h" - -+// TODO(jkardatzke): Remove this once the transition to the new upstream -+// protected content API is complete. This is used to bridge a transition -+// between the libva pull request we used, and what actually landed upstream. -+#ifndef LEGACY_UPSTREAM_PROTECTED_LIBVA -+#define LEGACY_UPSTREAM_PROTECTED_LIBVA -+#endif -+ - #include - - #include "base/memory/aligned_memory.h" -diff --git a/media/gpu/vaapi/h265_vaapi_video_decoder_delegate.h b/media/gpu/vaapi/h265_vaapi_video_decoder_delegate.h -index d152c3df8a90a..986c2b530076e 100644 ---- a/media/gpu/vaapi/h265_vaapi_video_decoder_delegate.h -+++ b/media/gpu/vaapi/h265_vaapi_video_decoder_delegate.h -@@ -5,6 +5,13 @@ - #ifndef MEDIA_GPU_VAAPI_H265_VAAPI_VIDEO_DECODER_DELEGATE_H_ - #define MEDIA_GPU_VAAPI_H265_VAAPI_VIDEO_DECODER_DELEGATE_H_ - -+// TODO(jkardatzke): Remove this once the transition to the new upstream -+// protected content API is complete. This is used to bridge a transition -+// between the libva pull request we used, and what actually landed upstream. -+#ifndef LEGACY_UPSTREAM_PROTECTED_LIBVA -+#define LEGACY_UPSTREAM_PROTECTED_LIBVA -+#endif -+ - #include - - #include "base/memory/scoped_refptr.h" -diff --git a/media/gpu/vaapi/va_prot.sigs b/media/gpu/vaapi/va_prot.sigs -index 1ffcd61778d11..dd13dafef1add 100644 ---- a/media/gpu/vaapi/va_prot.sigs -+++ b/media/gpu/vaapi/va_prot.sigs -@@ -9,5 +9,4 @@ VAStatus vaCreateProtectedSession(VADisplay dpy, VAConfigID config_id, VAProtect - VAStatus vaDestroyProtectedSession(VADisplay dpy, VAProtectedSessionID protected_session); - VAStatus vaAttachProtectedSession(VADisplay dpy, VAContextID reserved, VAProtectedSessionID protected_session); - VAStatus vaDetachProtectedSession(VADisplay dpy, VAContextID reserved); --VAStatus vaProtectedSessionHwUpdate(VADisplay dpy, VAProtectedSessionID protected_session, VABufferID buf_id); - VAStatus vaProtectedSessionExecute(VADisplay dpy, VAProtectedSessionID protected_session, VABufferID buf_id); -\ No newline at end of file -diff --git a/media/gpu/vaapi/vaapi_utils.h b/media/gpu/vaapi/vaapi_utils.h -index 9bcee23ce96d1..fd42ad2a148e3 100644 ---- a/media/gpu/vaapi/vaapi_utils.h -+++ b/media/gpu/vaapi/vaapi_utils.h -@@ -5,6 +5,13 @@ - #ifndef MEDIA_GPU_VAAPI_VAAPI_UTILS_H_ - #define MEDIA_GPU_VAAPI_VAAPI_UTILS_H_ - -+// TODO(jkardatzke): Remove this once the transition to the new upstream -+// protected content API is complete. This is used to bridge a transition -+// between the libva pull request we used, and what actually landed upstream. -+#ifndef LEGACY_UPSTREAM_PROTECTED_LIBVA -+#define LEGACY_UPSTREAM_PROTECTED_LIBVA -+#endif -+ - #include - - #include "base/callback_forward.h" -diff --git a/media/gpu/vaapi/vaapi_video_decoder_delegate.cc b/media/gpu/vaapi/vaapi_video_decoder_delegate.cc -index 07b7b3ce03f1b..a0a8ea67bd8c6 100644 ---- a/media/gpu/vaapi/vaapi_video_decoder_delegate.cc -+++ b/media/gpu/vaapi/vaapi_video_decoder_delegate.cc -@@ -133,11 +133,13 @@ VaapiVideoDecoderDelegate::SetupDecryptDecode( - DCHECK_EQ(protected_session_state_, ProtectedSessionState::kCreated); - - if (encryption_scheme_ == EncryptionScheme::kCenc) { -- crypto_params->encryption_type = -- full_sample ? VA_ENCRYPTION_TYPE_CENC_CTR : VA_ENCRYPTION_TYPE_CTR_128; -+ crypto_params->encryption_type = full_sample -+ ? VA_ENCRYPTION_TYPE_FULLSAMPLE_CTR -+ : VA_ENCRYPTION_TYPE_SUBSAMPLE_CTR; - } else { -- crypto_params->encryption_type = -- full_sample ? VA_ENCRYPTION_TYPE_CENC_CBC : VA_ENCRYPTION_TYPE_CBC; -+ crypto_params->encryption_type = full_sample -+ ? VA_ENCRYPTION_TYPE_FULLSAMPLE_CBC -+ : VA_ENCRYPTION_TYPE_SUBSAMPLE_CBC; - } - - // For multi-slice we may already have segment information in here, so -@@ -224,6 +226,7 @@ VaapiVideoDecoderDelegate::SetupDecryptDecode( - memcpy(crypto_params->wrapped_decrypt_blob, - hw_key_data_map_[decrypt_config_->key_id()].data(), - DecryptConfig::kDecryptionKeySize); -+ crypto_params->key_blob_size = DecryptConfig::kDecryptionKeySize; - crypto_params->segment_info = &segments->front(); - #else // if BUILDFLAG(IS_CHROMEOS_ASH) - protected_session_state_ = ProtectedSessionState::kFailed; -diff --git a/media/gpu/vaapi/vaapi_video_decoder_delegate.h b/media/gpu/vaapi/vaapi_video_decoder_delegate.h -index 1e222a41c543c..aeb48a75bd2c9 100644 ---- a/media/gpu/vaapi/vaapi_video_decoder_delegate.h -+++ b/media/gpu/vaapi/vaapi_video_decoder_delegate.h -@@ -5,6 +5,13 @@ - #ifndef MEDIA_GPU_VAAPI_VAAPI_VIDEO_DECODER_DELEGATE_H_ - #define MEDIA_GPU_VAAPI_VAAPI_VIDEO_DECODER_DELEGATE_H_ - -+// TODO(jkardatzke): Remove this once the transition to the new upstream -+// protected content API is complete. This is used to bridge a transition -+// between the libva pull request we used, and what actually landed upstream. -+#ifndef LEGACY_UPSTREAM_PROTECTED_LIBVA -+#define LEGACY_UPSTREAM_PROTECTED_LIBVA -+#endif -+ - #include - #include - #include -diff --git a/media/gpu/vaapi/vaapi_wrapper.cc b/media/gpu/vaapi/vaapi_wrapper.cc -index 696ffaf00d866..cd2ee37998fbd 100644 ---- a/media/gpu/vaapi/vaapi_wrapper.cc -+++ b/media/gpu/vaapi/vaapi_wrapper.cc -@@ -133,7 +133,7 @@ enum class VaapiFunctions { - kVADestroyProtectedSession = 26, - kVAAttachProtectedSession = 27, - kVADetachProtectedSession = 28, -- kVAProtectedSessionHwUpdate = 29, -+ kVAProtectedSessionHwUpdate_Deprecated = 29, - kVAProtectedSessionExecute = 30, - // Anything else is captured in this last entry. - kOtherVAFunction = 31, -@@ -176,7 +176,7 @@ constexpr std::arraypush_back( -- {VAConfigAttribEncryption, VA_ENCRYPTION_TYPE_CTR_128}); -+ {VAConfigAttribEncryption, VA_ENCRYPTION_TYPE_SUBSAMPLE_CTR}); - required_attribs->push_back( - {VAConfigAttribDecProcessing, VA_DEC_PROCESSING}); - } -@@ -1852,13 +1852,14 @@ bool VaapiWrapper::CreateProtectedSession( - // We have to hold the VABuffer outside of the lock because its destructor - // will acquire the lock when it goes out of scope. We also must do this after - // we create the protected session. -- VAProtectedSessionHwUpdateBuffer hw_update_buf; -+ VAProtectedSessionExecuteBuffer hw_update_buf; - std::unique_ptr hw_update = CreateVABuffer( -- VAProtectedSessionHwUpdateBufferType, sizeof(hw_update_buf)); -+ VAProtectedSessionExecuteBufferType, sizeof(hw_update_buf)); - { - base::AutoLock auto_lock(*va_lock_); - constexpr size_t kHwIdentifierMaxSize = 64; - memset(&hw_update_buf, 0, sizeof(hw_update_buf)); -+ hw_update_buf.function_id = VA_TEE_EXEC_TEE_FUNCID_HW_UPDATE; - hw_update_buf.input.data_size = hw_config.size(); - hw_update_buf.input.data = - static_cast(const_cast(hw_config.data())); -@@ -1868,22 +1869,22 @@ bool VaapiWrapper::CreateProtectedSession( - if (!MapAndCopy_Locked( - hw_update->id(), - {hw_update->type(), hw_update->size(), &hw_update_buf})) { -- LOG(ERROR) << "Failed mapping HwUpdate buf"; -+ LOG(ERROR) << "Failed mapping Execute buf"; - return false; - } - -- VAStatus va_res = vaProtectedSessionHwUpdate( -+ VAStatus va_res = vaProtectedSessionExecute( - va_display_, va_protected_session_id_, hw_update->id()); -- VA_SUCCESS_OR_RETURN(va_res, VaapiFunctions::kVAProtectedSessionHwUpdate, -+ VA_SUCCESS_OR_RETURN(va_res, VaapiFunctions::kVAProtectedSessionExecute, - false); - - ScopedVABufferMapping mapping(va_lock_, va_display_, hw_update->id()); - if (!mapping.IsValid()) { -- LOG(ERROR) << "Failed mapping returned HwUpdate buf"; -+ LOG(ERROR) << "Failed mapping returned Execute buf"; - return false; - } - auto* hw_update_buf_out = -- reinterpret_cast(mapping.data()); -+ reinterpret_cast(mapping.data()); - if (!hw_update_buf_out->output.data_size) { - LOG(ERROR) << "Received empty HW identifier"; - return false; -@@ -1964,10 +1965,9 @@ bool VaapiWrapper::IsProtectedSessionDead() { - if (va_protected_session_id_ == VA_INVALID_ID) - return false; - -- constexpr uint32_t kVaTeeExecGpuFuncIdIsSessionAlive = 0x40000103; - uint8_t alive; - VAProtectedSessionExecuteBuffer tee_exec_buf = {}; -- tee_exec_buf.function_id = kVaTeeExecGpuFuncIdIsSessionAlive; -+ tee_exec_buf.function_id = VA_TEE_EXEC_TEE_FUNCID_IS_SESSION_ALIVE; - tee_exec_buf.input.data_size = 0; - tee_exec_buf.input.data = nullptr; - tee_exec_buf.output.data_size = sizeof(alive); -@@ -2518,7 +2518,7 @@ std::unique_ptr VaapiWrapper::CreateVABuffer(VABufferType type, - base::AutoLock auto_lock(*va_lock_); - TRACE_EVENT0("media,gpu", "VaapiWrapper::CreateVABufferLocked"); - #if BUILDFLAG(IS_CHROMEOS_ASH) -- VAContextID context_id = type == VAProtectedSessionHwUpdateBufferType -+ VAContextID context_id = type == VAProtectedSessionExecuteBufferType - ? va_protected_session_id_ - : va_context_id_; - #else -@@ -2807,8 +2807,8 @@ bool VaapiWrapper::Initialize(CodecMode mode, - for (auto& attrib : required_attribs) { - if (attrib.type == VAConfigAttribEncryption) { - attrib.value = (encryption_scheme == EncryptionScheme::kCbcs) -- ? VA_ENCRYPTION_TYPE_CBC -- : VA_ENCRYPTION_TYPE_CTR_128; -+ ? VA_ENCRYPTION_TYPE_SUBSAMPLE_CBC -+ : VA_ENCRYPTION_TYPE_SUBSAMPLE_CTR; - } - } - } -diff --git a/media/gpu/vaapi/vaapi_wrapper.h b/media/gpu/vaapi/vaapi_wrapper.h -index 29b6864998240..f58723a0e852e 100644 ---- a/media/gpu/vaapi/vaapi_wrapper.h -+++ b/media/gpu/vaapi/vaapi_wrapper.h -@@ -10,6 +10,13 @@ - #ifndef MEDIA_GPU_VAAPI_VAAPI_WRAPPER_H_ - #define MEDIA_GPU_VAAPI_VAAPI_WRAPPER_H_ - -+// TODO(jkardatzke): Remove this once the transition to the new upstream -+// protected content API is complete. This is used to bridge a transition -+// between the libva pull request we used, and what actually landed upstream. -+#ifndef LEGACY_UPSTREAM_PROTECTED_LIBVA -+#define LEGACY_UPSTREAM_PROTECTED_LIBVA -+#endif -+ - #include - #include - #include -diff --git a/third_party/libva_protected_content/va_protected_content.h b/third_party/libva_protected_content/va_protected_content.h -index dfea3ce94a285..c14a77da41389 100644 ---- a/third_party/libva_protected_content/va_protected_content.h -+++ b/third_party/libva_protected_content/va_protected_content.h -@@ -46,6 +46,7 @@ extern "C" { - * @{ - */ - -+#ifdef LEGACY_UPSTREAM_PROTECTED_LIBVA - /** - * - * A protected content function for processing cipher protected content. -@@ -97,16 +98,19 @@ extern "C" { - /** \brief Encryption parameters buffer for content protection usage */ - #define VAEncryptionParameterBufferType ((VABufferType)0x20001) - -+#endif // LEGACY_UPSTREAM_PROTECTED_LIBVA -+ - /**\brief CENC status paramter, used for vendor content protection only. - * The buffer corresponds to #VACencStatusParameters for va/cp*/ - #define VACencStatusParameterBufferType ((VABufferType)0x20002) - -+#ifdef LEGACY_UPSTREAM_PROTECTED_LIBVA - /** attribute values for VAConfigAttribEncryption */ - #define VA_ENCRYPTION_TYPE_NONE 0x00000000 --#define VA_ENCRYPTION_TYPE_CENC_CBC 0x00000002 --#define VA_ENCRYPTION_TYPE_CENC_CTR 0x00000008 --#define VA_ENCRYPTION_TYPE_CTR_128 0x00000010 --#define VA_ENCRYPTION_TYPE_CBC 0x00000020 -+#define VA_ENCRYPTION_TYPE_FULLSAMPLE_CBC 0x00000002 -+#define VA_ENCRYPTION_TYPE_FULLSAMPLE_CTR 0x00000008 -+#define VA_ENCRYPTION_TYPE_SUBSAMPLE_CTR 0x00000010 -+#define VA_ENCRYPTION_TYPE_SUBSAMPLE_CBC 0x00000020 - - /** attribute values for VAConfigAttribContentProtectionSessionMode */ - #define VA_PC_SESSION_MODE_NONE 0x00000000 -@@ -132,18 +136,11 @@ extern "C" { - #define VA_PC_SAMPLE_TYPE_FULLSAMPLE 0x00000001 - #define VA_PC_SAMPLE_TYPE_SUBSAMPLE 0x00000002 - --/** \brief TeeExec Function Codes. */ --typedef enum _VA_TEE_EXEC_FUNCTION_ID { -- VA_TEE_EXEC_TEE_FUNCID_PASS_THROUGH_NONE = 0x0, -- -- // 0x40000000~0x400000FFF reserved for TEE Exec GPU function -- VA_TEE_EXEC_GPU_FUNCID_ENCRYPTION_BLT = 0x40000000, -- VA_TEE_EXEC_GPU_FUNCID_DECRYPTION_BLT = 0x40000001, -+#endif // LEGACY_UPSTREAM_PROTECTED_LIBVA - -- // 0x40001000~0x400001FFF reserved for TEE Exec TEE function -- VA_TEE_EXEC_TEE_FUNCID_PASS_THROUGH = 0x40001000, -- --} VA_TEE_EXEC_FUNCTION_ID; -+/** \brief TeeExec Function Codes. */ -+#define VA_TEE_EXEC_TEE_FUNCID_HW_UPDATE 0x40000002 -+#define VA_TEE_EXEC_TEE_FUNCID_IS_SESSION_ALIVE 0x40000103 - - /** \brief values for the encryption return status. */ - typedef enum { -@@ -159,6 +156,7 @@ typedef enum { - VA_ENCRYPTION_STATUS_UNSUPPORT - } VAEncryptionStatus; - -+#ifdef LEGACY_UPSTREAM_PROTECTED_LIBVA - /** \brief structure for encrypted segment info. */ - typedef struct _VAEncryptionSegmentInfo { - /** \brief The offset relative to the start of the bitstream input in -@@ -212,23 +210,12 @@ typedef struct _VAEncryptionParameters { - * encrypted, i.e. the CENC or CBC1 scheme is being used. - */ - uint32_t blocks_stripe_clear; -+ /* Forwards compatibility */ -+ uint32_t key_blob_size; - /** \brief Reserved bytes for future use, must be zero */ -- uint32_t va_reserved[VA_PADDING_MEDIUM]; -+ uint32_t va_reserved[VA_PADDING_MEDIUM - sizeof(uint32_t)]; - } VAEncryptionParameters; -- --/** \brief structure for VA_TEE_EXEC_GPU_FUNCID_ENCRYPTION_BLT */ --typedef struct _VA_PROTECTED_BLT_PARAMS { -- uint8_t* src_resource; // The source resource which contains the clear data. -- uint8_t* -- dst_resource; // The Destination resource. This resource will contain the -- // encrypted data. It should be allocated by the caller. -- uint32_t width; // The width of the surface in Bytes. -- uint32_t height; // The height of the surface in Bytes (pay attention that -- // for NV12 the height(Bytes) = 1.5*height(Pixel)). -- VAEncryptionParameters* -- enc_params; // The encryption parameters as defined by application -- void* reserved_extension; // The reserved extension for future BLT operations --} VA_PROTECTED_BLT_PARAMS; -+#endif // LEGACY_UPSTREAM_PROTECTED_LIBVA - - /** \brief cenc status parameters, corresponding to - * #VACencStatusParameterBufferType*/ -@@ -311,184 +298,6 @@ typedef struct _VACencSliceParameterBufferH264 { - uint32_t va_reserved[VA_PADDING_MEDIUM]; - } VACencSliceParameterBufferH264; - --/** -- * \brief Slice parameter for HEVC cenc decode in main & main 10 profiles. -- * -- * This structure holds information for \c -- * slice_segment_header() and nal_unit_header() of the slice as -- * defined by the HEVC specification. -- * -- */ --typedef struct _VACencSliceParameterBufferHEVC { -- /** \brief Same as the HEVC bitstream syntax element. */ -- uint8_t nal_unit_type; -- /** \brief Corresponds to the HEVC bitstream syntax element. -- * Same as nuh_temporal_id_plus1 - 1*/ -- uint8_t nuh_temporal_id; -- /** \brief Slice type. -- * Corresponds to HEVC syntax element of the same name. */ -- uint8_t slice_type; -- /** \brief Same as the HEVC bitstream syntax element. */ -- uint16_t slice_pic_order_cnt_lsb; -- /** \brief Indicates EOS_NUT or EOB_NUT is detected in picture. */ -- uint16_t has_eos_or_eob; -- -- union { -- struct { -- /** \brief Same as the HEVC bitstream syntax element */ -- uint32_t no_output_of_prior_pics_flag : 1; -- /** \brief Same as the HEVC bitstream syntax element */ -- uint32_t pic_output_flag : 1; -- /** \brief Same as the HEVC bitstream syntax element */ -- uint32_t colour_plane_id : 2; -- /** \brief Reserved for future use, must be zero */ -- uint32_t reserved : 19; -- } bits; -- uint32_t value; -- } slice_fields; -- -- /** \brief Parameters for driver reference frame set */ -- /**@{*/ -- -- /** \brief number of entries as current before in short-term rps -- * Corresponds to NumPocStCurrBefore as the HEVC specification. */ -- uint8_t num_of_curr_before; -- /** \brief number of entries as current after in short-term rps -- * Corresponds to NumPocStCurrAfter as the HEVC specification. */ -- uint8_t num_of_curr_after; -- /** \brief number of entries as current total in short-term rps*/ -- uint8_t num_of_curr_total; -- /** \brief number of entries as foll in short-term rps -- * Corresponds to NumPocStFoll as the HEVC specification.*/ -- uint8_t num_of_foll_st; -- /** \brief number of entries as current in long-term rps -- * Corresponds to NumPocLtCurr as the HEVC specification. */ -- uint8_t num_of_curr_lt; -- /** \brief number of entries as foll in long-term rps -- * Corresponds to NumPocLtFoll as the HEVC specification.*/ -- uint8_t num_of_foll_lt; -- /** \brief delta poc as short-term current before -- * Corresponds to PocStCurrBefore as the HEVC specification. */ -- int32_t delta_poc_curr_before[8]; -- /** \brief delta poc as short-term current after -- * Corresponds to PocStCurrAfter, as the HEVC specification.*/ -- int32_t delta_poc_curr_after[8]; -- /** \brief delta poc as short-term current total */ -- int32_t delta_poc_curr_total[8]; -- /** \brief delta poc as short-term foll -- * Corresponds to PocStFoll as the HEVC specification.*/ -- int32_t delta_poc_foll_st[16]; -- /** \brief delta poc as long-term current -- * Corresponds to PocLtCurr as the HEVC specification.*/ -- int32_t delta_poc_curr_lt[8]; -- /** \brief delta poc as long-term foll -- * Corresponds to PocLtFoll, as the HEVC specification.*/ -- int32_t delta_poc_foll_lt[16]; -- /** \brief delta poc msb present flag -- * Same as the HEVC bitstream syntax element. */ -- uint8_t delta_poc_msb_present_flag[16]; -- /** \brief long-term reference RPS is used for reference by current picture*/ -- uint8_t is_lt_curr_total[8]; -- /** \brief index of reference picture list. [0] is for P and B slice, [1] is -- * for B slice*/ -- uint8_t ref_list_idx[2][16]; -- /**@}*/ -- /** \brief Pointer to the next #VACencSliceParameterBufferHEVC element, -- * or \c nullptr if there is none.*/ -- void* next; -- -- /** \brief Reserved bytes for future use, must be zero */ -- uint32_t va_reserved[VA_PADDING_MEDIUM]; --} VACencSliceParameterBufferHEVC; -- --/** -- * \brief uncompressed header for VP9 cenc decode -- * -- * This structure holds information for \c -- * uncompressed_header() as defined by the VP9 specification. -- * -- */ --typedef struct _VACencSliceParameterBufferVP9 { -- union { -- struct { -- /** \brief Same as the VP9 bitstream syntax element. */ -- uint32_t profile : 2; -- /** \brief Same as the VP9 bitstream syntax element. */ -- uint32_t show_existing_frame_flag : 1; -- /** \brief Same as the VP9 bitstream syntax element. */ -- uint32_t frame_to_show_map_idx : 3; -- /** \brief Same as the VP9 bitstream syntax element. */ -- uint32_t frame_type : 1; -- /** \brief Same as the VP9 bitstream syntax element. */ -- uint32_t show_frame : 1; -- /** \brief Same as the VP9 bitstream syntax element. */ -- uint32_t error_resilient_mode : 1; -- /** \brief Same as the VP9 bitstream syntax element. */ -- uint32_t intra_only : 1; -- /** \brief Same as the VP9 bitstream syntax element. */ -- uint32_t ten_or_twelve_bit : 1; -- /** \brief Same as the VP9 bitstream syntax element. */ -- uint32_t color_space : 3; -- /** \brief Same as the VP9 bitstream syntax element. */ -- uint32_t color_range : 1; -- /** \brief Same as the VP9 bitstream syntax element. */ -- uint32_t subsampling_x : 1; -- /** \brief Same as the VP9 bitstream syntax element. */ -- uint32_t subsampling_y : 1; -- /** \brief Corresponds to ref_frame_idx[0] -- * as the VP9 specification */ -- uint32_t ref_frame_idx0 : 3; -- /** \brief Corresponds to ref_frame_sign_bias[LAST_FRAME] -- * as the VP9 specification */ -- uint32_t ref_frame_sign_bias0 : 1; -- /** \brief Corresponds to ref_frame_idx[1] -- * as the VP9 specification */ -- uint32_t ref_frame_idx1 : 3; -- /** \brief Corresponds to ref_frame_sign_bias[GOLDEN_FRAME] -- * as the VP9 specification */ -- uint32_t ref_frame_sign_bias1 : 1; -- /** \brief Corresponds to ref_frame_idx[2] -- * as the VP9 specification */ -- uint32_t ref_frame_idx2 : 3; -- /** \brief Corresponds to ref_frame_sign_bias[ALTREF_FRAME] -- * as the VP9 specification */ -- uint32_t ref_frame_sign_bias2 : 1; -- /** \brief Same as the VP9 bitstream syntax element. */ -- uint32_t frame_parallel_decoding_mode : 1; -- /** \brief Same as the VP9 bitstream syntax element. */ -- uint32_t render_and_frame_size_different : 1; -- /** \brief Reserved for future use, must be zero */ -- uint32_t reserved : 1; -- } bits; -- uint32_t value; -- } header_fields; -- /** \brief Same as the VP9 bitstream syntax element. */ -- uint16_t frame_width_minus1; -- /** \brief Same as the VP9 bitstream syntax element. */ -- uint16_t frame_height_minus1; -- /** \brief Same as the VP9 bitstream syntax element. */ -- uint16_t render_width_minus1; -- /** \brief Same as the VP9 bitstream syntax element. */ -- uint16_t render_height_minus1; -- /** \brief Same as the VP9 bitstream syntax element. */ -- uint8_t refresh_frame_flags; -- /** \brief Parameters for super frame*/ -- /**@{*/ -- /** \brief Superframe index, from 0 to frames_in_superframe_minus_1. -- * as the VP9 specification */ -- uint8_t sf_index; -- /** \brief Superframe size, corresponds to frame_sizes[ sf_index ] -- * as the VP9 specification */ -- uint32_t sf_frame_size; -- /**@}*/ -- /** \brief Pointer to the next #VACencSliceParameterBufferVP9 element, -- * or \c nullptr if there is none.*/ -- void* next; -- -- /** \brief Reserved bytes for future use, must be zero */ -- uint32_t va_reserved[VA_PADDING_MEDIUM]; --} VACencSliceParameterBufferVP9; -- - /** \brief Cenc Slice Buffer Type*/ - typedef enum { - /** \brief Parsed slice parameters \c VACencSliceParameterBuffer* */ -diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml -index e88db8a3f1201..c1bd0d7db925f 100644 ---- a/tools/metrics/histograms/enums.xml -+++ b/tools/metrics/histograms/enums.xml -@@ -77050,7 +77050,7 @@ Full version information for the fingerprint enum values: - - - -- -+ - - - diff --git a/chromium-100-GLImplementationParts-constexpr.patch b/chromium-100-GLImplementationParts-constexpr.patch deleted file mode 100644 index 437e672..0000000 --- a/chromium-100-GLImplementationParts-constexpr.patch +++ /dev/null @@ -1,92 +0,0 @@ -From d32156fd3773330eca99e9cba5e18db57aaa1a53 Mon Sep 17 00:00:00 2001 -From: Stephan Hartmann -Date: Sat, 19 Feb 2022 10:14:24 +0000 -Subject: [PATCH] GCC: make GLImplementationParts constructors constexpr - -Fix build error in GCC, as the constexpr operator== requires its -invocations to be also constexpr. ---- - ui/gl/gl_implementation.cc | 23 ----------------------- - ui/gl/gl_implementation.h | 25 +++++++++++++++++++++++-- - 2 files changed, 23 insertions(+), 25 deletions(-) - -diff --git a/ui/gl/gl_implementation.cc b/ui/gl/gl_implementation.cc -index e4e5456..3e4a47c 100644 ---- a/ui/gl/gl_implementation.cc -+++ b/ui/gl/gl_implementation.cc -@@ -26,29 +26,6 @@ - - namespace gl { - --ANGLEImplementation MakeANGLEImplementation( -- const GLImplementation gl_impl, -- const ANGLEImplementation angle_impl) { -- if (gl_impl == kGLImplementationEGLANGLE) { -- if (angle_impl == ANGLEImplementation::kNone) { -- return ANGLEImplementation::kDefault; -- } else { -- return angle_impl; -- } -- } else { -- return ANGLEImplementation::kNone; -- } --} -- --GLImplementationParts::GLImplementationParts( -- const ANGLEImplementation angle_impl) -- : gl(kGLImplementationEGLANGLE), -- angle(MakeANGLEImplementation(kGLImplementationEGLANGLE, angle_impl)) {} -- --GLImplementationParts::GLImplementationParts(const GLImplementation gl_impl) -- : gl(gl_impl), -- angle(MakeANGLEImplementation(gl_impl, ANGLEImplementation::kDefault)) {} -- - bool GLImplementationParts::IsValid() const { - if (angle == ANGLEImplementation::kNone) { - return (gl != kGLImplementationEGLANGLE); -diff --git a/ui/gl/gl_implementation.h b/ui/gl/gl_implementation.h -index 376ed58..a2513ea 100644 ---- a/ui/gl/gl_implementation.h -+++ b/ui/gl/gl_implementation.h -@@ -59,8 +59,14 @@ enum class ANGLEImplementation { - }; - - struct GL_EXPORT GLImplementationParts { -- explicit GLImplementationParts(const ANGLEImplementation angle_impl); -- explicit GLImplementationParts(const GLImplementation gl_impl); -+ constexpr explicit GLImplementationParts(const ANGLEImplementation angle_impl) -+ : gl(kGLImplementationEGLANGLE), -+ angle(MakeANGLEImplementation(kGLImplementationEGLANGLE, angle_impl)) {} -+ -+ constexpr explicit GLImplementationParts(const GLImplementation gl_impl) -+ : gl(gl_impl), -+ angle(MakeANGLEImplementation(gl_impl, ANGLEImplementation::kDefault)) { -+ } - - GLImplementation gl = kGLImplementationNone; - ANGLEImplementation angle = ANGLEImplementation::kNone; -@@ -80,6 +86,21 @@ struct GL_EXPORT GLImplementationParts { - bool IsValid() const; - bool IsAllowed(const std::vector& allowed_impls) const; - std::string ToString() const; -+ -+ private: -+ constexpr ANGLEImplementation MakeANGLEImplementation( -+ const GLImplementation gl_impl, -+ const ANGLEImplementation angle_impl) { -+ if (gl_impl == kGLImplementationEGLANGLE) { -+ if (angle_impl == ANGLEImplementation::kNone) { -+ return ANGLEImplementation::kDefault; -+ } else { -+ return angle_impl; -+ } -+ } else { -+ return ANGLEImplementation::kNone; -+ } -+ } - }; - - struct GL_EXPORT GLWindowSystemBindingInfo { --- -2.34.1 - diff --git a/chromium-100-InMilliseconds-constexpr.patch b/chromium-100-InMilliseconds-constexpr.patch deleted file mode 100644 index cf4562a..0000000 --- a/chromium-100-InMilliseconds-constexpr.patch +++ /dev/null @@ -1,97 +0,0 @@ -From da6e3f6071fdabeb96c0805626418414b4a4cea8 Mon Sep 17 00:00:00 2001 -From: Stephan Hartmann -Date: Wed, 9 Feb 2022 17:56:21 +0000 -Subject: [PATCH] GCC: make base::InMilliseconds(F,RoundedUp) constexpr - -media::DecodeTimestamp uses it in several constexpr methods. ---- - base/time/time.cc | 24 ------------------------ - base/time/time.h | 30 +++++++++++++++++++++++++++--- - 2 files changed, 27 insertions(+), 27 deletions(-) - -diff --git a/base/time/time.cc b/base/time/time.cc -index 0de273e..e0acda2 100644 ---- a/base/time/time.cc -+++ b/base/time/time.cc -@@ -74,30 +74,6 @@ int TimeDelta::InDaysFloored() const { - : std::numeric_limits::max(); - } - --double TimeDelta::InMillisecondsF() const { -- if (!is_inf()) -- return static_cast(delta_) / Time::kMicrosecondsPerMillisecond; -- return (delta_ < 0) ? -std::numeric_limits::infinity() -- : std::numeric_limits::infinity(); --} -- --int64_t TimeDelta::InMilliseconds() const { -- if (!is_inf()) -- return delta_ / Time::kMicrosecondsPerMillisecond; -- return (delta_ < 0) ? std::numeric_limits::min() -- : std::numeric_limits::max(); --} -- --int64_t TimeDelta::InMillisecondsRoundedUp() const { -- if (!is_inf()) { -- const int64_t result = delta_ / Time::kMicrosecondsPerMillisecond; -- // Convert |result| from truncating to ceiling. -- return (delta_ > result * Time::kMicrosecondsPerMillisecond) ? (result + 1) -- : result; -- } -- return delta_; --} -- - double TimeDelta::InMicrosecondsF() const { - if (!is_inf()) - return static_cast(delta_); -diff --git a/base/time/time.h b/base/time/time.h -index c027aab..fb1d78d 100644 ---- a/base/time/time.h -+++ b/base/time/time.h -@@ -216,9 +216,9 @@ class BASE_EXPORT TimeDelta { - constexpr int InMinutes() const; - constexpr double InSecondsF() const; - constexpr int64_t InSeconds() const; -- double InMillisecondsF() const; -- int64_t InMilliseconds() const; -- int64_t InMillisecondsRoundedUp() const; -+ constexpr double InMillisecondsF() const; -+ constexpr int64_t InMilliseconds() const; -+ constexpr int64_t InMillisecondsRoundedUp() const; - constexpr int64_t InMicroseconds() const { return delta_; } - double InMicrosecondsF() const; - constexpr int64_t InNanoseconds() const; -@@ -889,6 +889,30 @@ constexpr int64_t TimeDelta::InSeconds() const { - return is_inf() ? delta_ : (delta_ / Time::kMicrosecondsPerSecond); - } - -+constexpr double TimeDelta::InMillisecondsF() const { -+ if (!is_inf()) -+ return static_cast(delta_) / Time::kMicrosecondsPerMillisecond; -+ return (delta_ < 0) ? -std::numeric_limits::infinity() -+ : std::numeric_limits::infinity(); -+} -+ -+constexpr int64_t TimeDelta::InMilliseconds() const { -+ if (!is_inf()) -+ return delta_ / Time::kMicrosecondsPerMillisecond; -+ return (delta_ < 0) ? std::numeric_limits::min() -+ : std::numeric_limits::max(); -+} -+ -+constexpr int64_t TimeDelta::InMillisecondsRoundedUp() const { -+ if (!is_inf()) { -+ const int64_t result = delta_ / Time::kMicrosecondsPerMillisecond; -+ // Convert |result| from truncating to ceiling. -+ return (delta_ > result * Time::kMicrosecondsPerMillisecond) ? (result + 1) -+ : result; -+ } -+ return delta_; -+} -+ - constexpr int64_t TimeDelta::InNanoseconds() const { - return base::ClampMul(delta_, Time::kNanosecondsPerMicrosecond); - } --- -2.34.1 - diff --git a/chromium-100-SCTHashdanceMetadata-move.patch b/chromium-100-SCTHashdanceMetadata-move.patch deleted file mode 100644 index 9039429..0000000 --- a/chromium-100-SCTHashdanceMetadata-move.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 364dc0067d1c20c7a2d21277a7ec0c4419d9bc11 Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Wed, 23 Feb 2022 12:18:57 +0100 -Subject: [PATCH] GCC: explicitely move return value of SCTHashdanceMetadata::ToValue - -GCC rejects to do Return Value Optimization in -SCTHashdanceMetadata::ToValue, because the copy constructor is -deleted, and in that scenario RVO is rejected in GCC: - ../../services/network/sct_auditing/sct_auditing_reporter.cc: In member function ‘base::Value network::SCTAuditingReporter::SCTHashdanceMetadata::ToValue() const’: - ../../services/network/sct_auditing/sct_auditing_reporter.cc:191:10: error: use of deleted function ‘base::Value::Value(const base::Value&)’ - 191 | return value; - | ^~~~~ - In file included from ../../services/network/sct_auditing/sct_auditing_reporter.h:14, - from ../../services/network/sct_auditing/sct_auditing_reporter.cc:5: - ../../base/values.h:254:3: note: declared here - 254 | Value(const Value&) = delete; - | ^~~~~ - -Bug: 819294 -Change-Id: I111e51dd10eee7b909d4ac3c0911aac18a589166 ---- - -diff --git a/services/network/sct_auditing/sct_auditing_reporter.cc b/services/network/sct_auditing/sct_auditing_reporter.cc -index a057e8e..365527b 100644 ---- a/services/network/sct_auditing/sct_auditing_reporter.cc -+++ b/services/network/sct_auditing/sct_auditing_reporter.cc -@@ -188,7 +188,7 @@ - kLogIdKey, base::Base64Encode(base::as_bytes(base::make_span(log_id)))); - value.SetKey(kLogMMDKey, base::TimeDeltaToValue(log_mmd)); - value.SetKey(kCertificateExpiry, base::TimeToValue(certificate_expiry)); -- return value; -+ return std::move(value); - } - - // static diff --git a/chromium-100-macro-typo.patch b/chromium-100-macro-typo.patch deleted file mode 100644 index 833f869..0000000 --- a/chromium-100-macro-typo.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 1183b14db8bd08d731ff3433c436887de00be3aa Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Fri, 18 Feb 2022 16:28:25 +0000 -Subject: [PATCH] Fix typo in non-clang GSL_OWNER macro - -GCC build fails because GSL_OWNER is not defined (GSL_OWNER_ was -the one actually declared). - -Bug: 819294 -Change-Id: I1c3d17cb1c08b9bc0e8a888452da9868c308ddb5 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3472080 -Reviewed-by: Daniel Cheng -Commit-Queue: Daniel Cheng -Cr-Commit-Position: refs/heads/main@{#972974} ---- - -diff --git a/base/compiler_specific.h b/base/compiler_specific.h -index eec5810..1ee8074 100644 ---- a/base/compiler_specific.h -+++ b/base/compiler_specific.h -@@ -386,7 +386,7 @@ - #define GSL_OWNER [[gsl::Owner]] - #define GSL_POINTER [[gsl::Pointer]] - #else --#define GSL_OWNER_ -+#define GSL_OWNER - #define GSL_POINTER - #endif - diff --git a/chromium-100.0.4896.60-missing-utility-for-std-exchange.patch b/chromium-100.0.4896.60-missing-utility-for-std-exchange.patch deleted file mode 100644 index 0bcd6c0..0000000 --- a/chromium-100.0.4896.60-missing-utility-for-std-exchange.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up chromium-98.0.4758.102/base/third_party/symbolize/symbolize.h.missing-utility-for-std-exchange chromium-98.0.4758.102/base/third_party/symbolize/symbolize.h ---- chromium-98.0.4758.102/base/third_party/symbolize/symbolize.h.missing-utility-for-std-exchange 2022-02-25 22:30:02.833745309 +0000 -+++ chromium-98.0.4758.102/base/third_party/symbolize/symbolize.h 2022-02-25 22:30:02.832745344 +0000 -@@ -58,6 +58,8 @@ - #include "config.h" - #include "glog/logging.h" - -+#include -+ - #ifdef HAVE_SYMBOLIZE - - #include diff --git a/chromium-100.0.4896.75-missing-include-tuple.patch b/chromium-100.0.4896.75-missing-include-tuple.patch deleted file mode 100644 index a354ad5..0000000 --- a/chromium-100.0.4896.75-missing-include-tuple.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up chromium-100.0.4896.75/net/base/address_list.h.missing-include-tuple chromium-100.0.4896.75/net/base/address_list.h ---- chromium-100.0.4896.75/net/base/address_list.h.missing-include-tuple 2022-04-08 10:03:31.950894611 -0400 -+++ chromium-100.0.4896.75/net/base/address_list.h 2022-04-08 10:03:43.926970267 -0400 -@@ -8,6 +8,7 @@ - #include - - #include -+#include - #include - #include - diff --git a/chromium-100.0.4896.75-missing-include-vector.patch b/chromium-100.0.4896.75-missing-include-vector.patch deleted file mode 100644 index 4e524d8..0000000 --- a/chromium-100.0.4896.75-missing-include-vector.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up chromium-100.0.4896.75/media/capabilities/webrtc_video_stats_db.h.missing-vector chromium-100.0.4896.75/media/capabilities/webrtc_video_stats_db.h ---- chromium-100.0.4896.75/media/capabilities/webrtc_video_stats_db.h.missing-vector 2022-04-11 18:10:09.979195562 -0400 -+++ chromium-100.0.4896.75/media/capabilities/webrtc_video_stats_db.h 2022-04-11 18:10:30.261338074 -0400 -@@ -7,6 +7,7 @@ - - #include - #include -+#include - - #include "base/callback_forward.h" - #include "base/check.h" diff --git a/chromium-100.0.4896.75-old-xkb.patch b/chromium-100.0.4896.75-old-xkb.patch deleted file mode 100644 index e12b244..0000000 --- a/chromium-100.0.4896.75-old-xkb.patch +++ /dev/null @@ -1,49 +0,0 @@ -diff -up chromium-100.0.4896.75/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc.old-xkb chromium-100.0.4896.75/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc ---- chromium-100.0.4896.75/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc.old-xkb 2022-04-08 10:12:14.725197002 -0400 -+++ chromium-100.0.4896.75/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc 2022-04-08 10:13:04.512511489 -0400 -@@ -31,14 +31,6 @@ - #include "ui/events/keycodes/keyboard_code_conversion.h" - #include "ui/events/keycodes/keyboard_code_conversion_xkb.h" - --// xkb_keymap_key_get_mods_for_level is relatively new (introduced in ver 1.0, --// Sep 6, 2020), thus it is not available on some platform, such as Ubuntu --// 18.04, which we still supports. --// Thus declare the function as weak here, so we can check the availability on --// runtime. --extern "C" __attribute__((weak)) decltype( -- xkb_keymap_key_get_mods_for_level) xkb_keymap_key_get_mods_for_level; -- - namespace ui { - - namespace { -@@ -925,18 +917,10 @@ void XkbKeyboardLayoutEngine::SetKeymap( - const xkb_keysym_t* keysyms; - int num_syms = xkb_keymap_key_get_syms_by_level(keymap, keycode, layout, - level, &keysyms); -- if (xkb_keymap_key_get_mods_for_level) { -- xkb_mod_mask_t masks[100]; // Large enough buffer. -- int num_mods = xkb_keymap_key_get_mods_for_level( -- keymap, keycode, layout, level, masks, std::size(masks)); -- AddEntries(base::make_span(keysyms, num_syms), -- base::make_span(masks, num_mods), keycode); -- } else { - // If not, unfortunately, there's no convenient/efficient way - // to take the possible masks. Thus, use mask 0 always. - constexpr xkb_mod_mask_t kMask[] = {0}; - AddEntries(base::make_span(keysyms, num_syms), kMask, keycode); -- } - } - } - } -@@ -1000,10 +984,7 @@ int XkbKeyboardLayoutEngine::UpdateModif - - DomCode XkbKeyboardLayoutEngine::GetDomCodeByKeysym(uint32_t keysym, - uint32_t modifiers) const { -- // If xkb_keymap_key_get_mods_for_level is not available, all entries are -- // stored with modifiers mask is 0. -- if (!xkb_keymap_key_get_mods_for_level) -- modifiers = 0; -+ modifiers = 0; - - auto iter = xkb_keysym_map_.find(XkbKeysymMapKey(keysym, modifiers)); - if (iter == xkb_keysym_map_.end()) { diff --git a/chromium-100.0.4896.75-remoting-extra-qualification.patch b/chromium-100.0.4896.75-remoting-extra-qualification.patch deleted file mode 100644 index 9d4b625..0000000 --- a/chromium-100.0.4896.75-remoting-extra-qualification.patch +++ /dev/null @@ -1,147 +0,0 @@ -diff -up chromium-100.0.4896.75/remoting/host/mojom/remoting_mojom_traits.h.remoting-extra-qualification chromium-100.0.4896.75/remoting/host/mojom/remoting_mojom_traits.h ---- chromium-100.0.4896.75/remoting/host/mojom/remoting_mojom_traits.h.remoting-extra-qualification 2022-04-05 20:02:25.525814644 +0000 -+++ chromium-100.0.4896.75/remoting/host/mojom/remoting_mojom_traits.h 2022-04-07 13:35:28.490655471 +0000 -@@ -30,7 +30,7 @@ - namespace mojo { - - template <> --class mojo::StructTraits { -+class StructTraits { - public: - static bool value(bool value) { return value; } - -@@ -41,7 +41,7 @@ class mojo::StructTraits --class mojo::StructTraits { -+class StructTraits { - public: - static float value(float value) { return value; } - -@@ -52,7 +52,7 @@ class mojo::StructTraits --class mojo::StructTraits { -+class StructTraits { - public: - static int32_t value(int32_t value) { return value; } - -@@ -64,7 +64,7 @@ class mojo::StructTraits --class mojo::StructTraits { -+class StructTraits { - public: - static uint32_t value(uint32_t value) { return value; } - -@@ -76,7 +76,7 @@ class mojo::StructTraits --class mojo::StructTraits { - public: - static bool use_update_notifications( -@@ -101,7 +101,7 @@ class mojo::StructTraits --class mojo::StructTraits { - public: - static bool enable_curtaining( -@@ -161,7 +161,7 @@ class mojo::StructTraits --class mojo::StructTraits { - public: - static int32_t width(const ::webrtc::DesktopSize& size) { -@@ -177,7 +177,7 @@ class mojo::StructTraits --class mojo::StructTraits { - public: - static int32_t x(const ::webrtc::DesktopVector& vector) { return vector.x(); } -@@ -243,7 +243,7 @@ struct EnumTraits --class mojo::StructTraits { - public: - static const std::string& mime_type( -@@ -261,7 +261,7 @@ class mojo::StructTraits --class mojo::StructTraits { - public: - static bool pressed(const ::remoting::protocol::KeyEvent& event) { -@@ -297,7 +297,7 @@ class mojo::StructTraits --class mojo::StructTraits { - public: - static absl::optional x( -@@ -386,7 +386,7 @@ class mojo::StructTraits --class mojo::StructTraits { - public: - static const ::webrtc::DesktopSize& dimensions( -@@ -404,7 +404,7 @@ class mojo::StructTraits --class mojo::StructTraits { - public: - static const std::string& text(const ::remoting::protocol::TextEvent& event) { -@@ -416,7 +416,7 @@ class mojo::StructTraits --class mojo::StructTraits { - public: - static uint32_t id(const ::remoting::protocol::TouchEventPoint& event) { -@@ -493,7 +493,7 @@ struct EnumTraits --class mojo::StructTraits { - public: - static ::remoting::protocol::TouchEvent::TouchEventType event_type( -@@ -553,7 +553,7 @@ struct EnumTraits --class mojo::StructTraits { - public: - static ::remoting::protocol::TransportRoute::RouteType type( diff --git a/chromium-101.0.4951.41-remoting-extra-qualification.patch b/chromium-101.0.4951.41-remoting-extra-qualification.patch deleted file mode 100644 index c21ac38..0000000 --- a/chromium-101.0.4951.41-remoting-extra-qualification.patch +++ /dev/null @@ -1,165 +0,0 @@ -diff -up chromium-101.0.4951.41/remoting/host/mojom/remoting_mojom_traits.h.remoting-extra-qualification chromium-101.0.4951.41/remoting/host/mojom/remoting_mojom_traits.h ---- chromium-101.0.4951.41/remoting/host/mojom/remoting_mojom_traits.h.remoting-extra-qualification 2022-04-27 20:08:44.312318089 +0000 -+++ chromium-101.0.4951.41/remoting/host/mojom/remoting_mojom_traits.h 2022-04-28 16:11:30.308481321 +0000 -@@ -32,7 +32,7 @@ - namespace mojo { - - template <> --class mojo::StructTraits { -+class StructTraits { - public: - static bool value(bool value) { return value; } - -@@ -43,7 +43,7 @@ class mojo::StructTraits --class mojo::StructTraits { -+class StructTraits { - public: - static float value(float value) { return value; } - -@@ -54,7 +54,7 @@ class mojo::StructTraits --class mojo::StructTraits { -+class StructTraits { - public: - static int32_t value(int32_t value) { return value; } - -@@ -66,7 +66,7 @@ class mojo::StructTraits --class mojo::StructTraits { -+class StructTraits { - public: - static uint32_t value(uint32_t value) { return value; } - -@@ -78,7 +78,7 @@ class mojo::StructTraits --class mojo::StructTraits { - public: - static bool use_update_notifications( -@@ -103,7 +103,7 @@ class mojo::StructTraits --class mojo::StructTraits { - public: - static bool enable_curtaining( -@@ -200,7 +200,7 @@ struct EnumTraits --class mojo::StructTraits { - public: - static int32_t left(const ::webrtc::DesktopRect& rect) { return rect.left(); } -@@ -220,7 +220,7 @@ class mojo::StructTraits --class mojo::StructTraits { - public: - static int32_t width(const ::webrtc::DesktopSize& size) { -@@ -236,7 +236,7 @@ class mojo::StructTraits --class mojo::StructTraits { - public: - static int32_t x(const ::webrtc::DesktopVector& vector) { return vector.x(); } -@@ -475,7 +475,7 @@ struct EnumTraits --class mojo::StructTraits> { - public: - static int32_t timestamp( -@@ -513,7 +513,7 @@ class mojo::StructTraits --class mojo::StructTraits { - public: - static const std::string& mime_type( -@@ -531,7 +531,7 @@ class mojo::StructTraits --class mojo::StructTraits { - public: - static bool pressed(const ::remoting::protocol::KeyEvent& event) { -@@ -567,7 +567,7 @@ class mojo::StructTraits --class mojo::StructTraits { - public: - static absl::optional x( -@@ -656,7 +656,7 @@ class mojo::StructTraits --class mojo::StructTraits { - public: - static const ::webrtc::DesktopSize& dimensions( -@@ -674,7 +674,7 @@ class mojo::StructTraits --class mojo::StructTraits { - public: - static const std::string& text(const ::remoting::protocol::TextEvent& event) { -@@ -686,7 +686,7 @@ class mojo::StructTraits --class mojo::StructTraits { - public: - static uint32_t id(const ::remoting::protocol::TouchEventPoint& event) { -@@ -763,7 +763,7 @@ struct EnumTraits --class mojo::StructTraits { - public: - static ::remoting::protocol::TouchEvent::TouchEventType event_type( -@@ -823,7 +823,7 @@ struct EnumTraits --class mojo::StructTraits { - public: - static ::remoting::protocol::TransportRoute::RouteType type( diff --git a/chromium-102-fenced_frame_utils-include.patch b/chromium-102-fenced_frame_utils-include.patch deleted file mode 100644 index 61f904b..0000000 --- a/chromium-102-fenced_frame_utils-include.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 7c135a291184b59a59643ed6a8c40b4405ac0175 Mon Sep 17 00:00:00 2001 -From: Stephan Hartmann -Date: Wed, 27 Apr 2022 16:01:01 +0000 -Subject: [PATCH] IWYU: add cstring for std::strlen in fenced_frame_utils - ---- - third_party/blink/common/fenced_frame/fenced_frame_utils.cc | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/third_party/blink/common/fenced_frame/fenced_frame_utils.cc b/third_party/blink/common/fenced_frame/fenced_frame_utils.cc -index 9e2d3ad..68f4823 100644 ---- a/third_party/blink/common/fenced_frame/fenced_frame_utils.cc -+++ b/third_party/blink/common/fenced_frame/fenced_frame_utils.cc -@@ -4,6 +4,8 @@ - - #include "third_party/blink/public/common/fenced_frame/fenced_frame_utils.h" - -+#include -+ - #include "base/guid.h" - #include "base/strings/string_util.h" - --- -2.35.1 - diff --git a/chromium-102-regex_pattern-array.patch b/chromium-102-regex_pattern-array.patch deleted file mode 100644 index 18058b1..0000000 --- a/chromium-102-regex_pattern-array.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/components/autofill/core/browser/BUILD.gn -+++ b/components/autofill/core/browser/BUILD.gn -@@ -54,6 +54,11 @@ action("regex_patterns_inl_h") { - } - - static_library("browser") { -+ if (is_clang) { -+ cflags = [ -+ "-fbracket-depth=1000", -+ ] -+ } - sources = [ - "address_normalization_manager.cc", - "address_normalization_manager.h", diff --git a/chromium-102-swiftshader-template-instantiation.patch b/chromium-102-swiftshader-template-instantiation.patch deleted file mode 100644 index 13584d5..0000000 --- a/chromium-102-swiftshader-template-instantiation.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 89c498edff683c68df6be0dd224848f4b4af5ae7 Mon Sep 17 00:00:00 2001 -From: Stephan Hartmann -Date: Mon, 25 Apr 2022 13:25:02 +0200 -Subject: [PATCH] GCC: add explicit template instantiation - -Bug: b/223668065 -Change-Id: I97ea197273f2b46b6a47a9fdfbbfb5065fbd8edd -Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/65268 -Kokoro-Result: kokoro -Reviewed-by: Nicolas Capens -Reviewed-by: Alexis Hétu -Commit-Queue: Alexis Hétu -Tested-by: Alexis Hétu ---- - -diff --git a/third_party/swiftshader/third_party/subzero/src/IceInstX8632.cpp b/third_party/swiftshader/third_party/subzero/src/IceInstX8632.cpp -index fe87eee..94cac3b 100644 ---- a/third_party/swiftshader/third_party/subzero/src/IceInstX8632.cpp -+++ b/third_party/swiftshader/third_party/subzero/src/IceInstX8632.cpp -@@ -710,6 +710,11 @@ - } - } - -+template void emitIASRegOpTyGPR(const Cfg *Func, Type Ty, -+ const Variable *Var, -+ const Operand *Src, -+ const GPREmitterRegOp &Emitter); -+ - void emitIASAddrOpTyGPR(const Cfg *Func, Type Ty, const AsmAddress &Addr, - const Operand *Src, const GPREmitterAddrOp &Emitter) { - Assembler *Asm = Func->getAssembler(); -diff --git a/third_party/swiftshader/third_party/subzero/src/IceInstX8664.cpp b/third_party/swiftshader/third_party/subzero/src/IceInstX8664.cpp -index 9d655a1..f7097d2 100644 ---- a/third_party/swiftshader/third_party/subzero/src/IceInstX8664.cpp -+++ b/third_party/swiftshader/third_party/subzero/src/IceInstX8664.cpp -@@ -698,6 +698,11 @@ - } - } - -+template void emitIASRegOpTyGPR(const Cfg *Func, Type Ty, -+ const Variable *Var, -+ const Operand *Src, -+ const GPREmitterRegOp &Emitter); -+ - void emitIASAddrOpTyGPR(const Cfg *Func, Type Ty, const AsmAddress &Addr, - const Operand *Src, const GPREmitterAddrOp &Emitter) { - Assembler *Asm = Func->getAssembler(); diff --git a/chromium-102-symbolize-include.patch b/chromium-102-symbolize-include.patch deleted file mode 100644 index f4ac31d..0000000 --- a/chromium-102-symbolize-include.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 9dd0503835dc875807ab63efb1f477bffed2a852 Mon Sep 17 00:00:00 2001 -From: Stephan Hartmann -Date: Mon, 25 Apr 2022 23:18:30 +0000 -Subject: [PATCH] IWYU: add utility for std::exchange - -Bug: 957519 -Change-Id: I307d520fdc34d2452018ed32a505e7e519739410 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3604643 -Reviewed-by: Wez -Commit-Queue: Stephan Hartmann -Cr-Commit-Position: refs/heads/main@{#995855} ---- - -diff --git a/base/third_party/symbolize/patches/0001-expose-object-file-helpers.patch b/base/third_party/symbolize/patches/0001-expose-object-file-helpers.patch -index b7376d8..72900a19 100644 ---- a/base/third_party/symbolize/patches/0001-expose-object-file-helpers.patch -+++ b/base/third_party/symbolize/patches/0001-expose-object-file-helpers.patch -@@ -118,11 +118,12 @@ - index c6f9ec4360ede..00cfa022219e6 100644 - --- a/base/third_party/symbolize/symbolize.h - +++ b/base/third_party/symbolize/symbolize.h --@@ -60,6 +60,8 @@ -+@@ -60,6 +60,9 @@ - - #ifdef HAVE_SYMBOLIZE - - +#include -++#include - + - #if defined(__ELF__) // defined by gcc - #if defined(__OpenBSD__) -diff --git a/base/third_party/symbolize/symbolize.h b/base/third_party/symbolize/symbolize.h -index 99029a9..278078f 100644 ---- a/base/third_party/symbolize/symbolize.h -+++ b/base/third_party/symbolize/symbolize.h -@@ -61,6 +61,7 @@ - #ifdef HAVE_SYMBOLIZE - - #include -+#include - - #if defined(__ELF__) // defined by gcc - #if defined(__OpenBSD__) diff --git a/chromium-103-FrameLoadRequest-type.patch b/chromium-103-FrameLoadRequest-type.patch deleted file mode 100644 index cdace4b..0000000 --- a/chromium-103-FrameLoadRequest-type.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 491bf840da4f76fa3591cc0aa2f4c19cdbe57ec4 Mon Sep 17 00:00:00 2001 -From: Stephan Hartmann -Date: Thu, 12 May 2022 11:58:29 +0000 -Subject: [PATCH] GCC: fix ambiguous references in blink::FrameLoadRequest - -Add namespace to avoid confusion. ---- - third_party/blink/renderer/core/loader/frame_load_request.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/third_party/blink/renderer/core/loader/frame_load_request.h b/third_party/blink/renderer/core/loader/frame_load_request.h -index 444b25c..a86814d 100644 ---- a/third_party/blink/renderer/core/loader/frame_load_request.h -+++ b/third_party/blink/renderer/core/loader/frame_load_request.h -@@ -179,7 +179,7 @@ struct CORE_EXPORT FrameLoadRequest { - impression_ = impression; - } - -- const absl::optional& Impression() const { return impression_; } -+ const absl::optional& Impression() const { return impression_; } - - bool CanDisplay(const KURL&) const; - --- -2.35.1 - diff --git a/chromium-103-SubstringSetMatcher-packed.patch b/chromium-103-SubstringSetMatcher-packed.patch deleted file mode 100644 index ae27bfc..0000000 --- a/chromium-103-SubstringSetMatcher-packed.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 3d274856e792a361336eb4ae1670bc9c1905f0cb Mon Sep 17 00:00:00 2001 -From: Steinar H. Gunderson -Date: Thu, 12 May 2022 16:42:40 +0200 -Subject: [PATCH] Make AhoCorasickNode 4-aligned. - -This should fix an issue where std::vector could allocate unaligned -memory for AhoCorasickNode, and we'd then return a pointer to -inline_edges, where a caller would expect the pointer to be aligned -but it wasn't. - -Change-Id: Id9dff044c61f8e46062c63b8480b18ebc68c4862 ---- - -diff --git a/base/substring_set_matcher/substring_set_matcher.cc b/base/substring_set_matcher/substring_set_matcher.cc -index e110047..ef0b750 100644 ---- a/base/substring_set_matcher/substring_set_matcher.cc -+++ b/base/substring_set_matcher/substring_set_matcher.cc -@@ -424,7 +424,12 @@ - edges_.inline_edges[num_edges()] = AhoCorasickEdge{label, node}; - if (label == kFailureNodeLabel) { - // Make sure that kFailureNodeLabel is first. -- std::swap(edges_.inline_edges[0], edges_.inline_edges[num_edges()]); -+ // NOTE: We don't use std::swap here, because GCC -+ // doesn't understand that inline_edges[] is 4-aligned -+ // and gives a warning. -+ AhoCorasickEdge temp = edges_.inline_edges[0]; -+ edges_.inline_edges[0] = edges_.inline_edges[num_edges()]; -+ edges_.inline_edges[num_edges()] = temp; - } - --num_free_edges_; - return; -diff --git a/base/substring_set_matcher/substring_set_matcher.cc b/base/substring_set_matcher/substring_set_matcher.cc -index e110047..ef0b750 100644 ---- a/base/substring_set_matcher/substring_set_matcher.h -+++ b/base/substring_set_matcher/substring_set_matcher.h -@@ -154,8 +154,9 @@ - static constexpr uint32_t kEmptyLabel = 0x103; - - // A node in the trie, packed tightly together so that it occupies 12 bytes -- // (both on 32- and 64-bit platforms). -- class AhoCorasickNode { -+ // (both on 32- and 64-bit platforms), but aligned to at least 4 (see the -+ // comment on edges_). -+ class alignas(AhoCorasickEdge) AhoCorasickNode { - public: - AhoCorasickNode(); - ~AhoCorasickNode(); -@@ -178,6 +179,10 @@ - NodeID GetEdgeNoInline(uint32_t label) const; - void SetEdge(uint32_t label, NodeID node); - const AhoCorasickEdge* edges() const { -+ // NOTE: Returning edges_.inline_edges here is fine, because it's -+ // the first thing in the struct (see the comment on edges_). -+ DCHECK_EQ(0u, reinterpret_cast(edges_.inline_edges) % -+ alignof(AhoCorasickEdge)); - return edges_capacity_ == 0 ? edges_.inline_edges : edges_.edges; - } - -@@ -258,6 +263,11 @@ - // in the first slot if it exists (ie., is not equal to kRootID), since we - // need to access that label during every single node we look at during - // traversal. -+ // -+ // NOTE: Keep this the first member in the struct, so that inline_edges gets -+ // 4-aligned (since the class is marked as such, despite being packed. -+ // Otherwise, edges() can return an unaligned pointer marked as aligned -+ // (the unalignedness gets lost). - static constexpr int kNumInlineEdges = 2; - union { - // Out-of-line edge storage, having room for edges_capacity_ elements. diff --git a/chromium-103.0.5060.53-python3-do-not-use-deprecated-mode-U.patch b/chromium-103.0.5060.53-python3-do-not-use-deprecated-mode-U.patch deleted file mode 100644 index e24f9d8..0000000 --- a/chromium-103.0.5060.53-python3-do-not-use-deprecated-mode-U.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up chromium-103.0.5060.53/tools/grit/grit/util.py.fix-python3 chromium-103.0.5060.53/tools/grit/grit/util.py ---- chromium-103.0.5060.53/tools/grit/grit/util.py.fix-python3 2022-06-30 19:38:05.483590098 +0000 -+++ chromium-103.0.5060.53/tools/grit/grit/util.py 2022-06-30 19:38:14.024304827 +0000 -@@ -209,7 +209,7 @@ def ReadFile(filename, encoding): - mode = 'rb' - encoding = None - else: -- mode = 'rU' -+ mode = 'r' - - with io.open(filename, mode, encoding=encoding) as f: - return f.read() diff --git a/chromium-104.0.5112.101-system-minizip-header-fix.patch b/chromium-104.0.5112.101-system-minizip-header-fix.patch deleted file mode 100644 index acda436..0000000 --- a/chromium-104.0.5112.101-system-minizip-header-fix.patch +++ /dev/null @@ -1,76 +0,0 @@ -diff -up chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc.system-minizip chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc ---- chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc.system-minizip 2022-08-18 23:16:03.451728329 +0000 -+++ chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc 2022-08-18 23:16:23.966049114 +0000 -@@ -21,8 +21,8 @@ limitations under the License. - #include "absl/status/status.h" // from @com_google_absl - #include "absl/strings/str_format.h" // from @com_google_absl - #include "absl/strings/string_view.h" // from @com_google_absl --#include "contrib/minizip/ioapi.h" --#include "contrib/minizip/unzip.h" -+#include -+#include - #include "flatbuffers/flatbuffers.h" // from @flatbuffers - #include "tensorflow/lite/schema/schema_generated.h" - #include "tensorflow_lite_support/cc/common.h" -diff -up chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc.system-minizip chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc ---- chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc.system-minizip 2022-08-18 23:16:52.463105585 +0000 -+++ chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc 2022-08-18 23:17:12.849430606 +0000 -@@ -19,8 +19,8 @@ limitations under the License. - #include - #include - --#include "contrib/minizip/ioapi.h" --#include "contrib/minizip/zip.h" -+#include -+#include - #include "flatbuffers/flatbuffers.h" // from @flatbuffers - #include "tensorflow/lite/schema/schema_generated.h" - #include "tensorflow_lite_support/cc/common.h" -diff -up chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc.system-minizip chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc ---- chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc.system-minizip 2022-08-18 23:18:14.697382850 +0000 -+++ chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc 2022-08-18 23:18:27.148970583 +0000 -@@ -19,7 +19,7 @@ limitations under the License. - #include - - #include "absl/strings/string_view.h" // from @com_google_absl --#include "contrib/minizip/ioapi.h" -+#include - - namespace tflite { - namespace metadata { -diff -up chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h.system-minizip chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h ---- chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h.system-minizip 2022-08-18 20:14:28.116854693 +0000 -+++ chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h 2022-08-18 20:14:28.115854726 +0000 -@@ -19,7 +19,7 @@ limitations under the License. - #include - - #include "absl/strings/string_view.h" // from @com_google_absl --#include "contrib/minizip/ioapi.h" -+#include - - namespace tflite { - namespace metadata { -diff -up chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc.system-minizip chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc ---- chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc.system-minizip 2022-08-18 23:19:14.807392634 +0000 -+++ chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc 2022-08-18 23:19:31.177850617 +0000 -@@ -19,7 +19,7 @@ limitations under the License. - #include - - #include "absl/strings/string_view.h" // from @com_google_absl --#include "contrib/minizip/ioapi.h" -+#include - - namespace tflite { - namespace metadata { -diff -up chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h.system-minizip chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h ---- chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h.system-minizip 2022-08-18 20:14:28.116854693 +0000 -+++ chromium-104.0.5112.101/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h 2022-08-18 20:14:28.116854693 +0000 -@@ -19,7 +19,7 @@ limitations under the License. - #include - - #include "absl/strings/string_view.h" // from @com_google_absl --#include "contrib/minizip/ioapi.h" -+#include - - namespace tflite { - namespace metadata { diff --git a/chromium-105-AdjustMaskLayerGeometry-ceilf.patch b/chromium-105-AdjustMaskLayerGeometry-ceilf.patch deleted file mode 100644 index e347fa0..0000000 --- a/chromium-105-AdjustMaskLayerGeometry-ceilf.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 385068e1eb1cde9629d18ceee1fd13255c70c806 Mon Sep 17 00:00:00 2001 -From: Stephan Hartmann -Date: Fri, 22 Jul 2022 18:29:24 +0000 -Subject: [PATCH] libstdc++: use math.h in blink::AdjustMaskLayerGeometry - -libstdc++ does not implement std::ceilf. Use ceilf from math.h -instead. - -Bug: 957519 -Change-Id: I03b5e0a1eb73fdeae34d5f3d2f2e9c8871c52543 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3782841 -Commit-Queue: Stephan Hartmann -Reviewed-by: Juanmi Huertas -Cr-Commit-Position: refs/heads/main@{#1027342} ---- - -diff --git a/third_party/blink/renderer/platform/graphics/compositing/adjust_mask_layer_geometry.cc b/third_party/blink/renderer/platform/graphics/compositing/adjust_mask_layer_geometry.cc -index 4abe1d9..b5b43da 100644 ---- a/third_party/blink/renderer/platform/graphics/compositing/adjust_mask_layer_geometry.cc -+++ b/third_party/blink/renderer/platform/graphics/compositing/adjust_mask_layer_geometry.cc -@@ -4,8 +4,9 @@ - - #include "third_party/blink/renderer/platform/graphics/compositing/adjust_mask_layer_geometry.h" - -+#include - #include --#include -+ - #include "third_party/blink/renderer/platform/graphics/paint/geometry_mapper.h" - #include "third_party/blink/renderer/platform/graphics/paint/transform_paint_property_node.h" - #include "ui/gfx/geometry/size.h" -@@ -29,8 +30,7 @@ - // Map a screen pixel into the layer. - GeometryMapper::SourceToDestinationRect(TransformPaintPropertyNode::Root(), - transform, pixel_rect); -- int outset = -- std::ceilf(std::max(pixel_rect.width(), pixel_rect.height()) * 2); -+ int outset = ceilf(std::max(pixel_rect.width(), pixel_rect.height()) * 2); - // Don't expand too far in extreme cases. - constexpr int kMaxOutset = 1000; - outset = std::min(kMaxOutset, outset); diff --git a/chromium-105-Bitmap-include.patch b/chromium-105-Bitmap-include.patch deleted file mode 100644 index 75d0161..0000000 --- a/chromium-105-Bitmap-include.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 8959d9d1c6e4ed083c278ab9e8def20a409052b9 Mon Sep 17 00:00:00 2001 -From: Stephan Hartmann -Date: Fri, 22 Jul 2022 16:51:28 +0000 -Subject: [PATCH] IWYU: add memory for std::unique_ptr in disk_cache::Bitmap - -Bug: 957519 -Change-Id: I123198345e5f9062329b7eabe980f312525c268b -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3779530 -Reviewed-by: Maks Orlovich -Commit-Queue: Stephan Hartmann -Cr-Commit-Position: refs/heads/main@{#1027289} ---- - -diff --git a/net/disk_cache/blockfile/bitmap.h b/net/disk_cache/blockfile/bitmap.h -index 07806cf..9ffa98b9 100644 ---- a/net/disk_cache/blockfile/bitmap.h -+++ b/net/disk_cache/blockfile/bitmap.h -@@ -8,6 +8,8 @@ - #include - #include - -+#include -+ - #include "base/memory/raw_ptr.h" - #include "net/base/net_export.h" - diff --git a/chromium-105-Trap-raw_ptr.patch b/chromium-105-Trap-raw_ptr.patch deleted file mode 100644 index d784052..0000000 --- a/chromium-105-Trap-raw_ptr.patch +++ /dev/null @@ -1,161 +0,0 @@ -From 632aad0141fe0008fa9babba4f1f514222fa2cda Mon Sep 17 00:00:00 2001 -From: Matthew Denton -Date: Mon, 01 Aug 2022 21:45:28 +0000 -Subject: [PATCH] [Linux sandbox] cleanup TrapRegistry's "atomics" - -TrapRegistry uses some hacky asm statements as compiler memory barriers -to prevent a signal handler from accessing a deleted array (in the case -that the store of the pointer to the new array is reordered after the -deletion of the old array and the signal handler grabs a pointer to the -old array after it's deleted). - -We have std::atomic_signal_fence for this now, so this uses it. - -This also changes the |trap_array_| pointer back to a raw pointer from -a raw_ptr. Usage of raw_ptr might be awkward as it is also accessed in -a signal handler, and in fact |trap_array_| is an owning pointer -anyway so raw_ptr is unnecessary. - -This came up in https://crrev.com/c/3789266 in which the use of raw_ptr -with the hacky compiler barriers was not supported by GCC. - -SMALL ADDITION: This also removes raw_ptr from the arch_sigsys struct; it was a raw pointer to a code instruction and likely would not have worked. It is also never dereferenced (only its value is used). - -NOTE 1: In technicality, all non-local variables accessed by the signal -handler must be either lock-free std::atomics or volatile sig_atomic_t. -None of Chrome's code does this and in fact, glibc just typedefs -sig_atomic_t to int. The std::atomic_signal_fence is enough on any -architecture. - -NOTE 2: This race condition is unlikely to ever happen even without -compiler barriers. The only time we might be modifying the -|trap_array_| and also accessing it from a signal handler, we must -have already applied a seccomp sandbox that uses traps, and now be -applying another one that uses traps. And to replace the deleted object, -the second sandbox must be getting applied in a multithreaded -environment, otherwise there would be no allocations after the free. - -Bug: 819294 - -Change-Id: I9f1cd417446dd863805a303e9b111bc862cb9ae2 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3788911 -Commit-Queue: Matthew Denton -Reviewed-by: Tom Sepez -Cr-Commit-Position: refs/heads/main@{#1030277} ---- - -diff --git a/sandbox/linux/seccomp-bpf/trap.cc b/sandbox/linux/seccomp-bpf/trap.cc -index cb71a9b..b0c0257 100644 ---- a/sandbox/linux/seccomp-bpf/trap.cc -+++ b/sandbox/linux/seccomp-bpf/trap.cc -@@ -12,12 +12,13 @@ - #include - - #include -+#include - #include - #include - - #include "base/compiler_specific.h" - #include "base/logging.h" --#include "base/memory/raw_ptr.h" -+#include "base/memory/raw_ptr_exclusion.h" - #include "build/build_config.h" - #include "sandbox/linux/bpf_dsl/seccomp_macros.h" - #include "sandbox/linux/seccomp-bpf/die.h" -@@ -29,7 +30,9 @@ - namespace { - - struct arch_sigsys { -- raw_ptr ip; -+ // This is not raw_ptr because it is a pointer to a code address given to us -+ // by the kernel. -+ RAW_PTR_EXCLUSION void* ip; - int nr; - unsigned int arch; - }; -@@ -77,11 +80,7 @@ - - namespace sandbox { - --Trap::Trap() -- : trap_array_(nullptr), -- trap_array_size_(0), -- trap_array_capacity_(0), -- has_unsafe_traps_(false) { -+Trap::Trap() { - // Set new SIGSYS handler - struct sigaction sa = {}; - // In some toolchain, sa_sigaction is not declared in struct sigaction. -@@ -239,7 +238,7 @@ - struct arch_seccomp_data data = { - static_cast(SECCOMP_SYSCALL(ctx)), - SECCOMP_ARCH, -- reinterpret_cast(sigsys.ip.get()), -+ reinterpret_cast(sigsys.ip), - {static_cast(SECCOMP_PARM1(ctx)), - static_cast(SECCOMP_PARM2(ctx)), - static_cast(SECCOMP_PARM3(ctx)), -@@ -333,24 +332,11 @@ - TrapKey* new_trap_array = new TrapKey[trap_array_capacity_]; - std::copy_n(old_trap_array, trap_array_size_, new_trap_array); - -- // Language specs are unclear on whether the compiler is allowed to move -- // the "delete[]" above our preceding assignments and/or memory moves, -- // iff the compiler believes that "delete[]" doesn't have any other -- // global side-effects. -- // We insert optimization barriers to prevent this from happening. -- // The first barrier is probably not needed, but better be explicit in -- // what we want to tell the compiler. -- // The clang developer mailing list couldn't answer whether this is a -- // legitimate worry; but they at least thought that the barrier is -- // sufficient to prevent the (so far hypothetical) problem of re-ordering -- // of instructions by the compiler. -- // -- // TODO(mdempsky): Try to clean this up using base/atomicops or C++11 -- // atomics; see crbug.com/414363. -- asm volatile("" : "=r"(new_trap_array) : "0"(new_trap_array) : "memory"); - trap_array_ = new_trap_array; -- asm volatile("" : "=r"(trap_array_) : "0"(trap_array_) : "memory"); -- -+ // Prevent the compiler from moving delete[] before the store of the -+ // |new_trap_array|, otherwise a concurrent SIGSYS may see a |trap_array_| -+ // that still points to |old_trap_array| after it has been deleted. -+ std::atomic_signal_fence(std::memory_order_release); - delete[] old_trap_array; - } - -diff --git a/sandbox/linux/seccomp-bpf/trap.h b/sandbox/linux/seccomp-bpf/trap.h -index cc17d26..37d2029 100644 ---- a/sandbox/linux/seccomp-bpf/trap.h -+++ b/sandbox/linux/seccomp-bpf/trap.h -@@ -10,7 +10,7 @@ - - #include - --#include "base/memory/raw_ptr.h" -+#include "base/memory/raw_ptr_exclusion.h" - #include "sandbox/linux/bpf_dsl/trap_registry.h" - #include "sandbox/linux/system_headers/linux_signal.h" - #include "sandbox/sandbox_export.h" -@@ -75,11 +75,15 @@ - // events. - static Trap* global_trap_; - -- TrapIds trap_ids_; // Maps from TrapKeys to numeric ids -- raw_ptr trap_array_; // Array of TrapKeys indexed by ids -- size_t trap_array_size_; // Currently used size of array -- size_t trap_array_capacity_; // Currently allocated capacity of array -- bool has_unsafe_traps_; // Whether unsafe traps have been enabled -+ TrapIds trap_ids_; // Maps from TrapKeys to numeric ids -+ // Array of TrapKeys indexed by ids. -+ // -+ // This is not a raw_ptr as it is an owning pointer anyway, and is meant to be -+ // used between normal code and signal handlers. -+ RAW_PTR_EXCLUSION TrapKey* trap_array_ = nullptr; -+ size_t trap_array_size_ = 0; // Currently used size of array -+ size_t trap_array_capacity_ = 0; // Currently allocated capacity of array -+ bool has_unsafe_traps_ = false; // Whether unsafe traps have been enabled - }; - - } // namespace sandbox diff --git a/chromium-105-browser_finder-include.patch b/chromium-105-browser_finder-include.patch deleted file mode 100644 index ab46427..0000000 --- a/chromium-105-browser_finder-include.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 41dca8bd0c5e8ac5197d7477c6f01556fb88fb43 Mon Sep 17 00:00:00 2001 -From: Stephan Hartmann -Date: Sun, 14 Aug 2022 08:41:11 +0000 -Subject: [PATCH] IWYU: add vector for std::vector in browser_finder.h - ---- - chrome/browser/ui/browser_finder.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/chrome/browser/ui/browser_finder.h b/chrome/browser/ui/browser_finder.h -index f885be0..ad7a184 100644 ---- a/chrome/browser/ui/browser_finder.h -+++ b/chrome/browser/ui/browser_finder.h -@@ -6,6 +6,7 @@ - #define CHROME_BROWSER_UI_BROWSER_FINDER_H_ - - #include -+#include - - #include "ui/display/types/display_constants.h" - #include "ui/gfx/native_widget_types.h" --- -2.35.1 - diff --git a/chromium-105-raw_ptr-noexcept.patch b/chromium-105-raw_ptr-noexcept.patch deleted file mode 100644 index 0c32524..0000000 --- a/chromium-105-raw_ptr-noexcept.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 72b19a6a725809f872a7e7525c9a83bcbda85ec7 Mon Sep 17 00:00:00 2001 -From: Stephan Hartmann -Date: Mon, 25 Jul 2022 09:19:19 +0000 -Subject: [PATCH] GCC: make raw_ptr move assignment operator noexcept - -Required in content::LevelDBScopesOptions, because move assignment -operator is noexcept too. - -Bug: 3762913 -Change-Id: Ic55ade0e15457eb7349fe24203307972d9030a8e -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3782669 -Reviewed-by: Keishi Hattori -Commit-Queue: Stephan Hartmann -Reviewed-by: Bartek Nowierski -Cr-Commit-Position: refs/heads/main@{#1027669} ---- - -diff --git a/base/memory/raw_ptr.h b/base/memory/raw_ptr.h -index 5d8c1cfd..9a62f03 100644 ---- a/base/memory/raw_ptr.h -+++ b/base/memory/raw_ptr.h -@@ -796,7 +796,7 @@ - return *this; - } - -- ALWAYS_INLINE raw_ptr& operator=(raw_ptr&& p) { -+ ALWAYS_INLINE raw_ptr& operator=(raw_ptr&& p) noexcept { - if (LIKELY(this != &p)) { - Impl::ReleaseWrappedPtr(wrapped_ptr_); - wrapped_ptr_ = p.wrapped_ptr_; diff --git a/chromium-105.0.5195.125-fix-wayland-menu.patch b/chromium-105.0.5195.125-fix-wayland-menu.patch deleted file mode 100644 index a4ce851..0000000 --- a/chromium-105.0.5195.125-fix-wayland-menu.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -up chromium-105.0.5195.125/ui/ozone/platform/wayland/host/wayland_window.cc.fix-wayland-menu chromium-105.0.5195.125/ui/ozone/platform/wayland/host/wayland_window.cc ---- chromium-105.0.5195.125/ui/ozone/platform/wayland/host/wayland_window.cc.fix-wayland-menu 2022-09-23 18:29:51.872286569 +0000 -+++ chromium-105.0.5195.125/ui/ozone/platform/wayland/host/wayland_window.cc 2022-09-23 18:30:18.819376074 +0000 -@@ -950,7 +950,7 @@ void WaylandWindow::ProcessPendingBounds - // window has been applied. - SetWindowGeometry(pending_bounds_dip_); - AckConfigure(serial); -- root_surface()->Commit(); -+ connection()->ScheduleFlush(); - } else if (!pending_configures_.empty() && - pending_bounds_dip_.size() == - pending_configures_.back().bounds_dip.size()) { -diff -up chromium-105.0.5195.125/ui/ozone/platform/wayland/wayland_buffer_manager_unittest.cc.fix-wayland-menu chromium-105.0.5195.125/ui/ozone/platform/wayland/wayland_buffer_manager_unittest.cc ---- chromium-105.0.5195.125/ui/ozone/platform/wayland/wayland_buffer_manager_unittest.cc.fix-wayland-menu 2022-09-23 18:30:41.936594397 +0000 -+++ chromium-105.0.5195.125/ui/ozone/platform/wayland/wayland_buffer_manager_unittest.cc 2022-09-23 18:31:31.703911576 +0000 -@@ -1103,9 +1103,7 @@ TEST_P(WaylandBufferManagerTest, TestCom - EXPECT_CALL(*xdg_surface, AckConfigure(_)).Times(1); - EXPECT_CALL(*mock_surface, Attach(_, _, _)).Times(1); - EXPECT_CALL(*mock_surface, Frame(_)).Times(1); -- // Commit() can be called a second time as part of the configure -> ack -- // sequence. -- EXPECT_CALL(*mock_surface, Commit()).Times(testing::Between(1, 2)); -+ EXPECT_CALL(*mock_surface, Commit()).Times(1); - - ActivateSurface(mock_surface->xdg_surface()); - Sync(); diff --git a/chromium-105.0.5195.52-gn-system.patch b/chromium-105.0.5195.52-gn-system.patch deleted file mode 100644 index e8c0bcc..0000000 --- a/chromium-105.0.5195.52-gn-system.patch +++ /dev/null @@ -1,207 +0,0 @@ -diff -up chromium-105.0.5195.52/build/linux/unbundle/libusb.gn.gnsystem chromium-105.0.5195.52/build/linux/unbundle/libusb.gn ---- chromium-105.0.5195.52/build/linux/unbundle/libusb.gn.gnsystem 2022-09-01 12:23:27.557313611 +0000 -+++ chromium-105.0.5195.52/build/linux/unbundle/libusb.gn 2022-09-01 12:23:27.557313611 +0000 -@@ -0,0 +1,24 @@ -+# Copyright 2016 The Chromium Authors. All rights reserved. -+# Use of this source code is governed by a BSD-style license that can be -+# found in the LICENSE file. -+ -+import("//build/config/linux/pkg_config.gni") -+import("//build/shim_headers.gni") -+ -+pkg_config("system_libusb") { -+ packages = [ "libusb-1.0" ] -+} -+ -+shim_headers("libusb_shim") { -+ root_path = "src/libusb" -+ headers = [ -+ "libusb.h", -+ ] -+} -+ -+source_set("libusb") { -+ deps = [ -+ ":libusb_shim", -+ ] -+ public_configs = [ ":system_libusb" ] -+} -diff -up chromium-105.0.5195.52/build/linux/unbundle/opus.gn.gnsystem chromium-105.0.5195.52/build/linux/unbundle/opus.gn ---- chromium-105.0.5195.52/build/linux/unbundle/opus.gn.gnsystem 2022-08-24 20:27:57.000000000 +0000 -+++ chromium-105.0.5195.52/build/linux/unbundle/opus.gn 2022-09-01 12:41:57.564878845 +0000 -@@ -1,3 +1,164 @@ -+# Copyright 2016 The Chromium Authors. All rights reserved. -+# Use of this source code is governed by a BSD-style license that can be -+# found in the LICENSE file. -+ -+import("//build/config/linux/pkg_config.gni") -+import("//build/shim_headers.gni") -+import("//testing/test.gni") -+ -+pkg_config("system_opus") { -+ packages = [ "opus" ] -+} -+ -+shim_headers("opus_shim") { -+ root_path = "src/include" -+ headers = [ -+ "opus_custom.h", -+ "opus_defines.h", -+ "opus_multistream.h", -+ "opus_types.h", -+ "opus.h", -+ ] -+} -+ -+source_set("opus") { -+ deps = [ -+ ":opus_shim", -+ ] -+ public_configs = [ ":system_opus" ] -+} -+ -+config("opus_test_config") { -+ include_dirs = [ -+ "src/celt", -+ "src/silk", -+ ] -+ -+ if (is_win) { -+ defines = [ "inline=__inline" ] -+ } -+ if (is_android) { -+ libs = [ "log" ] -+ } -+ if (is_clang) { -+ cflags = [ "-Wno-absolute-value" ] -+ } -+} -+ -+executable("opus_compare") { -+ sources = [ -+ "src/src/opus_compare.c", -+ ] -+ -+ configs -= [ "//build/config/compiler:chromium_code" ] -+ configs += [ -+ "//build/config/compiler:no_chromium_code", -+ ":opus_test_config", -+ ] -+ -+ deps = [ -+ ":opus", -+ "//build/config/sanitizers:deps", -+ "//build/win:default_exe_manifest", -+ ] -+} -+ -+executable("opus_demo") { -+ sources = [ -+ "src/src/opus_demo.c", -+ ] -+ -+ configs -= [ "//build/config/compiler:chromium_code" ] -+ configs += [ -+ "//build/config/compiler:no_chromium_code", -+ ":opus_test_config", -+ ] -+ -+ deps = [ -+ ":opus", -+ "//build/config/sanitizers:deps", -+ "//build/win:default_exe_manifest", -+ ] -+} -+ -+test("test_opus_api") { -+ sources = [ -+ "src/tests/test_opus_api.c", -+ ] -+ -+ configs -= [ "//build/config/compiler:chromium_code" ] -+ configs += [ -+ "//build/config/compiler:no_chromium_code", -+ ":opus_test_config", -+ ] -+ -+ deps = [ -+ ":opus", -+ ] -+} -+ -+test("test_opus_encode") { -+ sources = [ -+ "src/tests/test_opus_encode.c", -+ ] -+ -+ configs -= [ "//build/config/compiler:chromium_code" ] -+ configs += [ -+ "//build/config/compiler:no_chromium_code", -+ ":opus_test_config", -+ ] -+ -+ deps = [ -+ ":opus", -+ ] -+} -+ -+# GN orders flags on a target before flags from configs. The default config -+# adds -Wall, and this flag have to be after -Wall -- so they need to -+# come from a config and can't be on the target directly. -+config("test_opus_decode_config") { -+ # test_opus_decode passes a null pointer to opus_decode() for an argument -+ # marked as requiring a non-null value by the nonnull function attribute, -+ # and expects opus_decode() to fail. Disable the -Wnonnull option to avoid -+ # a compilation error if -Werror is specified. -+ if (is_posix) { -+ cflags = [ "-Wno-nonnull" ] -+ } -+} -+ -+test("test_opus_decode") { -+ sources = [ -+ "src/tests/test_opus_decode.c", -+ ] -+ -+ configs -= [ "//build/config/compiler:chromium_code" ] -+ configs += [ -+ "//build/config/compiler:no_chromium_code", -+ ":opus_test_config", -+ ":test_opus_decode_config", -+ ] -+ -+ deps = [ -+ ":opus", -+ ] -+} -+ -+test("test_opus_padding") { -+ sources = [ -+ "src/tests/test_opus_padding.c", -+ ] -+ -+ configs -= [ "//build/config/compiler:chromium_code" ] -+ configs += [ -+ "//build/config/compiler:no_chromium_code", -+ ":opus_test_config", -+ ] -+ -+ deps = [ -+ ":opus", -+ ] -+} -+ - # Copyright 2017 The Chromium Authors. All rights reserved. - # Use of this source code is governed by a BSD-style license that can be - # found in the LICENSE file. -diff -up chromium-105.0.5195.52/build/linux/unbundle/replace_gn_files.py.gnsystem chromium-105.0.5195.52/build/linux/unbundle/replace_gn_files.py ---- chromium-105.0.5195.52/build/linux/unbundle/replace_gn_files.py.gnsystem 2022-09-01 12:23:27.558313577 +0000 -+++ chromium-105.0.5195.52/build/linux/unbundle/replace_gn_files.py 2022-09-01 12:36:01.870847125 +0000 -@@ -52,6 +52,7 @@ REPLACEMENTS = { - 'libjpeg': 'third_party/libjpeg.gni', - 'libjxl' : 'third_party/libjxl/BUILD.gn', - 'libpng': 'third_party/libpng/BUILD.gn', -+ 'libusb': 'third_party/libusb/BUILD.gn', - 'libvpx': 'third_party/libvpx/BUILD.gn', - 'libwebp': 'third_party/libwebp/BUILD.gn', - 'libxml': 'third_party/libxml/BUILD.gn', diff --git a/chromium-107.0.5304.101-system-minizip-header-fix.patch b/chromium-107.0.5304.101-system-minizip-header-fix.patch new file mode 100644 index 0000000..5ce7fe5 --- /dev/null +++ b/chromium-107.0.5304.101-system-minizip-header-fix.patch @@ -0,0 +1,65 @@ +diff -up chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc.system-minizip chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc +--- chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc.system-minizip 2022-11-14 11:48:36.877164150 +0100 ++++ chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc 2022-11-14 11:51:55.791949494 +0100 +@@ -27,8 +27,8 @@ limitations under the License. + #include "tensorflow_lite_support/cc/port/status_macros.h" + #include "tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h" + #include "tensorflow_lite_support/metadata/metadata_schema_generated.h" +-#include "third_party/zlib/contrib/minizip/ioapi.h" +-#include "third_party/zlib/contrib/minizip/unzip.h" ++#include ++#include + + namespace tflite { + namespace metadata { +diff -up chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc.system-minizip chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc +--- chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc.system-minizip 2022-11-14 11:48:36.877164150 +0100 ++++ chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc 2022-11-14 11:52:36.233736347 +0100 +@@ -26,8 +26,8 @@ limitations under the License. + #include "tensorflow_lite_support/cc/port/statusor.h" + #include "tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h" + #include "tensorflow_lite_support/metadata/metadata_schema_generated.h" +-#include "third_party/zlib/contrib/minizip/ioapi.h" +-#include "third_party/zlib/contrib/minizip/unzip.h" ++#include ++#include + + namespace tflite { + namespace metadata { +diff -up chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc.system-minizip chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc +--- chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc.system-minizip 2022-11-09 01:41:13.000000000 +0100 ++++ chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc 2022-11-14 11:48:36.877164150 +0100 +@@ -19,7 +19,7 @@ limitations under the License. + #include + + #include "absl/strings/string_view.h" // from @com_google_absl +-#include "contrib/minizip/ioapi.h" ++#include + + namespace tflite { + namespace metadata { +diff -up chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h.system-minizip chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h +diff -up chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc.system-minizip chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc +--- chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc.system-minizip 2022-11-14 11:48:36.877164150 +0100 ++++ chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc 2022-11-14 11:53:57.365294462 +0100 +@@ -19,7 +19,7 @@ limitations under the License. + #include + + #include "absl/strings/string_view.h" // from @com_google_absl +-#include "third_party/zlib/contrib/minizip/ioapi.h" ++#include + + namespace tflite { + namespace metadata { +diff -up chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h.system-minizip chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h +--- chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h.system-minizip 2022-11-14 11:48:36.877164150 +0100 ++++ chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h 2022-11-14 11:54:21.318756738 +0100 +@@ -19,7 +19,7 @@ limitations under the License. + #include + + #include "absl/strings/string_view.h" // from @com_google_absl +-#include "third_party/zlib/contrib/minizip/ioapi.h" ++#include + + namespace tflite { + namespace metadata { diff --git a/chromium-107.0.5304.110-gn-system.patch b/chromium-107.0.5304.110-gn-system.patch new file mode 100644 index 0000000..4c94401 --- /dev/null +++ b/chromium-107.0.5304.110-gn-system.patch @@ -0,0 +1,39 @@ +diff -up chromium-105.0.5195.52/build/linux/unbundle/libusb.gn.gnsystem chromium-105.0.5195.52/build/linux/unbundle/libusb.gn +--- chromium-105.0.5195.52/build/linux/unbundle/libusb.gn.gnsystem 2022-09-01 12:23:27.557313611 +0000 ++++ chromium-105.0.5195.52/build/linux/unbundle/libusb.gn 2022-09-01 12:23:27.557313611 +0000 +@@ -0,0 +1,24 @@ ++# Copyright 2016 The Chromium Authors. All rights reserved. ++# Use of this source code is governed by a BSD-style license that can be ++# found in the LICENSE file. ++ ++import("//build/config/linux/pkg_config.gni") ++import("//build/shim_headers.gni") ++ ++pkg_config("system_libusb") { ++ packages = [ "libusb-1.0" ] ++} ++ ++shim_headers("libusb_shim") { ++ root_path = "src/libusb" ++ headers = [ ++ "libusb.h", ++ ] ++} ++ ++source_set("libusb") { ++ deps = [ ++ ":libusb_shim", ++ ] ++ public_configs = [ ":system_libusb" ] ++} +diff -up chromium-105.0.5195.52/build/linux/unbundle/replace_gn_files.py.gnsystem chromium-105.0.5195.52/build/linux/unbundle/replace_gn_files.py +--- chromium-105.0.5195.52/build/linux/unbundle/replace_gn_files.py.gnsystem 2022-09-01 12:23:27.558313577 +0000 ++++ chromium-105.0.5195.52/build/linux/unbundle/replace_gn_files.py 2022-09-01 12:36:01.870847125 +0000 +@@ -52,6 +52,7 @@ REPLACEMENTS = { + 'libjpeg': 'third_party/libjpeg.gni', + 'libjxl' : 'third_party/libjxl/BUILD.gn', + 'libpng': 'third_party/libpng/BUILD.gn', ++ 'libusb': 'third_party/libusb/BUILD.gn', + 'libvpx': 'third_party/libvpx/BUILD.gn', + 'libwebp': 'third_party/libwebp/BUILD.gn', + 'libxml': 'third_party/libxml/BUILD.gn', diff --git a/chromium-103.0.5060.53-remoting-extra-qualification.patch b/chromium-107.0.5304.110-remoting-extra-qualification.patch similarity index 71% rename from chromium-103.0.5060.53-remoting-extra-qualification.patch rename to chromium-107.0.5304.110-remoting-extra-qualification.patch index 37d2acf..9b9ce18 100644 --- a/chromium-103.0.5060.53-remoting-extra-qualification.patch +++ b/chromium-107.0.5304.110-remoting-extra-qualification.patch @@ -1,7 +1,7 @@ -diff -up chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h.remoting-extra-qualification chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h ---- chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h.remoting-extra-qualification 2022-06-27 22:16:20.214876025 +0000 -+++ chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h 2022-06-28 12:44:09.663890774 +0000 -@@ -37,7 +37,7 @@ +diff -up chromium-107.0.5304.110/remoting/host/mojom/remoting_mojom_traits.h.remoting-extra-qualification chromium-107.0.5304.110/remoting/host/mojom/remoting_mojom_traits.h +--- chromium-107.0.5304.110/remoting/host/mojom/remoting_mojom_traits.h.remoting-extra-qualification 2022-11-20 19:56:00.897740616 +0100 ++++ chromium-107.0.5304.110/remoting/host/mojom/remoting_mojom_traits.h 2022-11-21 09:21:47.967180137 +0100 +@@ -42,7 +42,7 @@ namespace mojo { template <> @@ -10,7 +10,7 @@ diff -up chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h.remo public: static bool value(bool value) { return value; } -@@ -48,7 +48,7 @@ class mojo::StructTraits @@ -19,7 +19,7 @@ diff -up chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h.remo public: static float value(float value) { return value; } -@@ -59,7 +59,7 @@ class mojo::StructTraits @@ -28,7 +28,7 @@ diff -up chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h.remo public: static int32_t value(int32_t value) { return value; } -@@ -71,7 +71,7 @@ class mojo::StructTraits @@ -37,7 +37,7 @@ diff -up chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h.remo public: static uint32_t value(uint32_t value) { return value; } -@@ -83,7 +83,7 @@ class mojo::StructTraits @@ -46,7 +46,7 @@ diff -up chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h.remo ::webrtc::DesktopCaptureOptions> { public: static bool use_update_notifications( -@@ -108,7 +108,7 @@ class mojo::StructTraits @@ -55,7 +55,7 @@ diff -up chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h.remo ::remoting::DesktopEnvironmentOptions> { public: static bool enable_curtaining( -@@ -205,7 +205,7 @@ struct EnumTraits @@ -64,7 +64,7 @@ diff -up chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h.remo ::webrtc::DesktopRect> { public: static int32_t left(const ::webrtc::DesktopRect& rect) { return rect.left(); } -@@ -225,7 +225,7 @@ class mojo::StructTraits @@ -73,7 +73,7 @@ diff -up chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h.remo ::webrtc::DesktopSize> { public: static int32_t width(const ::webrtc::DesktopSize& size) { -@@ -241,7 +241,7 @@ class mojo::StructTraits @@ -82,7 +82,7 @@ diff -up chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h.remo ::webrtc::DesktopVector> { public: static int32_t x(const ::webrtc::DesktopVector& vector) { return vector.x(); } -@@ -253,7 +253,7 @@ class mojo::StructTraits @@ -91,7 +91,7 @@ diff -up chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h.remo ::webrtc::MouseCursor> { public: static const webrtc::DesktopSize& image_size( -@@ -506,7 +506,7 @@ struct EnumTraits @@ -100,7 +100,7 @@ diff -up chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h.remo ::std::unique_ptr<::remoting::AudioPacket>> { public: static int32_t timestamp( -@@ -544,7 +544,7 @@ class mojo::StructTraits @@ -109,16 +109,34 @@ diff -up chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h.remo ::remoting::protocol::ClipboardEvent> { public: static const std::string& mime_type( -@@ -562,7 +562,7 @@ class mojo::StructTraits +-class mojo::UnionTraits< ++class UnionTraits< + remoting::mojom::ReadChunkResultDataView, + ::remoting::Result, + ::remoting::protocol::FileTransfer_Error>> { +@@ -606,7 +606,7 @@ class mojo::UnionTraits< + }; + + template <> +-class mojo::StructTraits { + public: + static ::remoting::protocol::FileTransfer_Error_Type type( +@@ -745,7 +745,7 @@ class mojo::UnionTraits< + #endif // BUILDFLAG(IS_WIN) + template <> -class mojo::StructTraits { public: static const ::google::protobuf:: -@@ -576,7 +576,7 @@ class mojo::StructTraits @@ -127,7 +145,7 @@ diff -up chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h.remo ::remoting::protocol::KeyboardLayout_KeyAction> { public: static remoting::mojom::KeyActionDataView::Tag GetTag( -@@ -609,7 +609,7 @@ class mojo::UnionTraits @@ -136,7 +154,7 @@ diff -up chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h.remo ::remoting::protocol::KeyboardLayout_KeyBehavior> { public: static const ::google::protobuf::Map< -@@ -967,7 +967,7 @@ struct EnumTraits @@ -145,7 +163,7 @@ diff -up chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h.remo ::remoting::protocol::KeyEvent> { public: static bool pressed(const ::remoting::protocol::KeyEvent& event) { -@@ -1003,7 +1003,7 @@ class mojo::StructTraits @@ -154,7 +172,7 @@ diff -up chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h.remo ::remoting::protocol::MouseEvent> { public: static absl::optional x( -@@ -1092,7 +1092,7 @@ class mojo::StructTraits @@ -163,7 +181,7 @@ diff -up chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h.remo ::remoting::ScreenResolution> { public: static const ::webrtc::DesktopSize& dimensions( -@@ -1110,7 +1110,7 @@ class mojo::StructTraits @@ -172,7 +190,7 @@ diff -up chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h.remo ::remoting::protocol::TextEvent> { public: static const std::string& text(const ::remoting::protocol::TextEvent& event) { -@@ -1122,7 +1122,7 @@ class mojo::StructTraits @@ -181,7 +199,7 @@ diff -up chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h.remo ::remoting::protocol::TouchEventPoint> { public: static uint32_t id(const ::remoting::protocol::TouchEventPoint& event) { -@@ -1199,7 +1199,7 @@ struct EnumTraits @@ -190,7 +208,7 @@ diff -up chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h.remo ::remoting::protocol::TouchEvent> { public: static ::remoting::protocol::TouchEvent::TouchEventType event_type( -@@ -1259,7 +1259,7 @@ struct EnumTraits @@ -199,7 +217,7 @@ diff -up chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h.remo ::remoting::protocol::TransportRoute> { public: static ::remoting::protocol::TransportRoute::RouteType type( -@@ -1406,7 +1406,7 @@ struct EnumTraits @@ -208,7 +226,7 @@ diff -up chromium-103.0.5060.53/remoting/host/mojom/remoting_mojom_traits.h.remo ::remoting::protocol::VideoLayout> { public: static const ::google::protobuf::RepeatedPtrField< -@@ -1425,7 +1425,7 @@ class mojo::StructTraits diff --git a/chromium-58.0.3029.96-revert-b794998819088f76b4cf44c8db6940240c563cf4.patch b/chromium-58.0.3029.96-revert-b794998819088f76b4cf44c8db6940240c563cf4.patch deleted file mode 100644 index ddb94a0..0000000 --- a/chromium-58.0.3029.96-revert-b794998819088f76b4cf44c8db6940240c563cf4.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -up chromium-58.0.3029.96/ui/events/devices/x11/device_data_manager_x11.cc.revert chromium-58.0.3029.96/ui/events/devices/x11/device_data_manager_x11.cc ---- chromium-58.0.3029.96/ui/events/devices/x11/device_data_manager_x11.cc.revert 2017-05-08 14:58:11.767482431 -0400 -+++ chromium-58.0.3029.96/ui/events/devices/x11/device_data_manager_x11.cc 2017-05-08 14:58:37.722960109 -0400 -@@ -790,15 +790,6 @@ void DeviceDataManagerX11::UpdateScrollC - DCHECK(deviceid >= 0 && deviceid < kMaxDeviceNum); - ScrollInfo& info = scroll_data_[deviceid]; - -- bool legacy_scroll_available = -- (scroll_class_info->flags & XIScrollFlagNoEmulation) == 0; -- // If the device's highest resolution is lower than the resolution of xinput1 -- // then use xinput1's events instead (ie. don't configure smooth scrolling). -- if (legacy_scroll_available && -- std::abs(scroll_class_info->increment) <= 1.0) { -- return; -- } -- - switch (scroll_class_info->scroll_type) { - case XIScrollTypeVertical: - info.vertical.number = scroll_class_info->number; diff --git a/chromium-60.0.3112.78-jpeg-nomangle.patch b/chromium-60.0.3112.78-jpeg-nomangle.patch deleted file mode 100644 index 0b758a4..0000000 --- a/chromium-60.0.3112.78-jpeg-nomangle.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -up chromium-60.0.3112.78/third_party/libjpeg_turbo/jpeglib.h.nomangle chromium-60.0.3112.78/third_party/libjpeg_turbo/jpeglib.h ---- chromium-60.0.3112.78/third_party/libjpeg_turbo/jpeglib.h.nomangle 2017-08-01 15:29:00.870759406 -0400 -+++ chromium-60.0.3112.78/third_party/libjpeg_turbo/jpeglib.h 2017-08-01 15:29:09.326593414 -0400 -@@ -18,10 +18,6 @@ - #ifndef JPEGLIB_H - #define JPEGLIB_H - --/* Begin chromium edits */ --#include "jpeglibmangler.h" --/* End chromium edits */ -- - /* - * First we include the configuration files that record how this - * installation of the JPEG library is set up. jconfig.h can be diff --git a/chromium-68.0.3440.106-master-prefs-path.patch b/chromium-68.0.3440.106-master-prefs-path.patch deleted file mode 100644 index 9304adf..0000000 --- a/chromium-68.0.3440.106-master-prefs-path.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -up chromium-68.0.3440.106/chrome/browser/first_run/first_run_internal_linux.cc.etc chromium-68.0.3440.106/chrome/browser/first_run/first_run_internal_linux.cc ---- chromium-68.0.3440.106/chrome/browser/first_run/first_run_internal_linux.cc.etc 2018-08-09 03:12:33.444705798 -0400 -+++ chromium-68.0.3440.106/chrome/browser/first_run/first_run_internal_linux.cc 2018-08-09 03:14:46.275754910 -0400 -@@ -19,9 +19,9 @@ bool IsOrganicFirstRun() { - - base::FilePath MasterPrefsPath() { - // The standard location of the master prefs is next to the chrome binary. -+ // ...but we patch it to use /etc/chromium - base::FilePath master_prefs; -- if (!base::PathService::Get(base::DIR_EXE, &master_prefs)) -- return base::FilePath(); -+ master_prefs = base::FilePath("/etc/chromium"); - return master_prefs.AppendASCII(installer::kDefaultMasterPrefs); - } - diff --git a/chromium-70.0.3538.67-disable-fontconfig-cache-magic.patch b/chromium-70.0.3538.67-disable-fontconfig-cache-magic.patch deleted file mode 100644 index 0c60643..0000000 --- a/chromium-70.0.3538.67-disable-fontconfig-cache-magic.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -up chromium-70.0.3538.67/base/test/BUILD.gn.nofc chromium-70.0.3538.67/base/test/BUILD.gn ---- chromium-70.0.3538.67/base/test/BUILD.gn.nofc 2018-10-29 11:29:01.356812567 -0400 -+++ chromium-70.0.3538.67/base/test/BUILD.gn 2018-10-29 11:29:12.631584916 -0400 -@@ -209,9 +209,6 @@ static_library("test_support") { - data_deps = [ - "//third_party/test_fonts", - ] -- if (current_toolchain == host_toolchain) { -- data_deps += [ ":do_generate_fontconfig_caches" ] -- } - } - - if (is_ios) { diff --git a/chromium-73.0.3683.75-norar.patch b/chromium-73.0.3683.75-norar.patch deleted file mode 100644 index d61fd9c..0000000 --- a/chromium-73.0.3683.75-norar.patch +++ /dev/null @@ -1,81 +0,0 @@ -diff -up chromium-73.0.3683.75/chrome/common/safe_browsing/BUILD.gn.nounrar chromium-73.0.3683.75/chrome/common/safe_browsing/BUILD.gn ---- chromium-73.0.3683.75/chrome/common/safe_browsing/BUILD.gn.nounrar 2019-03-13 08:59:45.988801102 -0400 -+++ chromium-73.0.3683.75/chrome/common/safe_browsing/BUILD.gn 2019-03-13 09:00:20.244977448 -0400 -@@ -64,41 +64,6 @@ if (safe_browsing_mode == 1) { - ] - } - -- source_set("rar_analyzer") { -- sources = [ -- "rar_analyzer.cc", -- "rar_analyzer.h", -- ] -- -- deps = [ -- ":archive_analyzer_results", -- ":download_type_util", -- ":file_type_policies", -- "//base", -- "//base:i18n", -- "//components/safe_browsing:features", -- "//third_party/unrar:unrar", -- ] -- -- defines = [ -- "_FILE_OFFSET_BITS=64", -- "LARGEFILE_SOURCE", -- "RAR_SMP", -- "SILENT", -- -- # The following is set to disable certain macro definitions in the unrar -- # source code. -- "CHROMIUM_UNRAR", -- -- # Disables exceptions in unrar, replaces them with process termination. -- "UNRAR_NO_EXCEPTIONS", -- ] -- -- public_deps = [ -- "//components/safe_browsing:csd_proto", -- ] -- } -- - source_set("disk_image_type_sniffer_mac") { - sources = [ - "disk_image_type_sniffer_mac.cc", -@@ -167,7 +132,6 @@ source_set("safe_browsing") { - ":archive_analyzer_results", - ":binary_feature_extractor", - ":download_type_util", -- ":rar_analyzer", - "//components/safe_browsing:features", - ] - -diff -up chromium-73.0.3683.75/chrome/common/safe_browsing/DEPS.nounrar chromium-73.0.3683.75/chrome/common/safe_browsing/DEPS ---- chromium-73.0.3683.75/chrome/common/safe_browsing/DEPS.nounrar 2019-03-11 18:00:54.000000000 -0400 -+++ chromium-73.0.3683.75/chrome/common/safe_browsing/DEPS 2019-03-13 08:59:26.513282690 -0400 -@@ -1,6 +1,5 @@ - include_rules = [ - "+components/safe_browsing", - "+third_party/protobuf", -- "+third_party/unrar", - "+third_party/zlib", - ] -diff -up chromium-73.0.3683.75/chrome/services/file_util/safe_archive_analyzer.cc.nounrar chromium-73.0.3683.75/chrome/services/file_util/safe_archive_analyzer.cc ---- chromium-73.0.3683.75/chrome/services/file_util/safe_archive_analyzer.cc.nounrar 2019-03-13 08:59:26.518282566 -0400 -+++ chromium-73.0.3683.75/chrome/services/file_util/safe_archive_analyzer.cc 2019-03-13 09:01:03.885935483 -0400 -@@ -48,10 +48,14 @@ void SafeArchiveAnalyzer::AnalyzeDmgFile - void SafeArchiveAnalyzer::AnalyzeRarFile(base::File rar_file, - base::File temporary_file, - AnalyzeRarFileCallback callback) { -+#if 0 - DCHECK(rar_file.IsValid()); - - safe_browsing::ArchiveAnalyzerResults results; - safe_browsing::rar_analyzer::AnalyzeRarFile( - std::move(rar_file), std::move(temporary_file), &results); - std::move(callback).Run(results); -+#else -+ NOTREACHED(); -+#endif - } diff --git a/chromium-75.0.3770.100-epel7-stdc++.patch b/chromium-75.0.3770.100-epel7-stdc++.patch deleted file mode 100644 index e4d62a0..0000000 --- a/chromium-75.0.3770.100-epel7-stdc++.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up chromium-75.0.3770.100/build/config/BUILD.gn.epel7 chromium-75.0.3770.100/build/config/BUILD.gn ---- chromium-75.0.3770.100/build/config/BUILD.gn.epel7 2019-06-20 10:10:03.099549006 -0400 -+++ chromium-75.0.3770.100/build/config/BUILD.gn 2019-06-20 10:10:21.483158162 -0400 -@@ -267,6 +267,7 @@ config("default_libs") { - "dl", - "pthread", - "rt", -+ "stdc++", - ] - } - } diff --git a/chromium-75.0.3770.80-vaapi-i686-fpermissive.patch b/chromium-75.0.3770.80-vaapi-i686-fpermissive.patch deleted file mode 100644 index c44473d..0000000 --- a/chromium-75.0.3770.80-vaapi-i686-fpermissive.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -up chromium-75.0.3770.80/media/gpu/vaapi/BUILD.gn.i686permissive chromium-75.0.3770.80/media/gpu/vaapi/BUILD.gn ---- chromium-75.0.3770.80/media/gpu/vaapi/BUILD.gn.i686permissive 2019-06-10 14:47:37.315515026 -0400 -+++ chromium-75.0.3770.80/media/gpu/vaapi/BUILD.gn 2019-06-10 14:48:25.250604888 -0400 -@@ -11,6 +11,10 @@ import("//ui/ozone/ozone.gni") - - assert(use_vaapi) - -+config("vaapi_permissive") { -+ cflags = [ "-fpermissive" ] -+} -+ - generate_stubs("libva_stubs") { - extra_header = "va_stub_header.fragment" - sigs = [ "va.sigs" ] -@@ -89,6 +93,8 @@ source_set("vaapi") { - deps += [ "//media/gpu/linux" ] - } - -+ configs += [ ":vaapi_permissive" ] -+ - if (use_x11) { - configs += [ "//build/config/linux:x11" ] - deps += [ "//ui/gfx/x" ] diff --git a/chromium-76.0.3809.100-gcc-no-alignas-and-export.patch b/chromium-76.0.3809.100-gcc-no-alignas-and-export.patch deleted file mode 100644 index cc91d1e..0000000 --- a/chromium-76.0.3809.100-gcc-no-alignas-and-export.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -up chromium-76.0.3809.100/third_party/blink/renderer/core/css/css_property_value_set.h.gcc-no-alignas chromium-76.0.3809.100/third_party/blink/renderer/core/css/css_property_value_set.h ---- chromium-76.0.3809.100/third_party/blink/renderer/core/css/css_property_value_set.h.gcc-no-alignas 2019-08-09 16:48:13.000000000 +0200 -+++ chromium-76.0.3809.100/third_party/blink/renderer/core/css/css_property_value_set.h 2019-08-15 21:04:30.231532746 +0200 -@@ -176,8 +176,8 @@ class CSSLazyPropertyParser - DISALLOW_COPY_AND_ASSIGN(CSSLazyPropertyParser); - }; - --class CORE_EXPORT alignas(Member) alignas( -- CSSPropertyValueMetadata) ImmutableCSSPropertyValueSet -+class CORE_EXPORT ALIGNAS(alignof(Member)) -+ ALIGNAS(alignof(CSSPropertyValueMetadata)) ImmutableCSSPropertyValueSet - : public CSSPropertyValueSet { - public: - ImmutableCSSPropertyValueSet(const CSSPropertyValue*, diff --git a/chromium-76.0.3809.100-gcc-remoting-constexpr.patch b/chromium-76.0.3809.100-gcc-remoting-constexpr.patch deleted file mode 100644 index aec3107..0000000 --- a/chromium-76.0.3809.100-gcc-remoting-constexpr.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff -up chromium-76.0.3809.100/remoting/signaling/message_tracker.cc.gcc-constexpr chromium-76.0.3809.100/remoting/signaling/message_tracker.cc ---- chromium-76.0.3809.100/remoting/signaling/message_tracker.cc.gcc-constexpr 2019-08-09 16:48:08.000000000 +0200 -+++ chromium-76.0.3809.100/remoting/signaling/message_tracker.cc 2019-08-20 21:29:14.545465656 +0200 -@@ -9,8 +9,7 @@ - namespace remoting { - - // static --const base::TimeDelta MessageTracker::kCleanupInterval = -- base::TimeDelta::FromMinutes(2); -+constexpr base::TimeDelta MessageTracker::kCleanupInterval; - - MessageTracker::MessageTracker() = default; - -diff -up chromium-76.0.3809.100/remoting/signaling/message_tracker.h.gcc-constexpr chromium-76.0.3809.100/remoting/signaling/message_tracker.h ---- chromium-76.0.3809.100/remoting/signaling/message_tracker.h.gcc-constexpr 2019-08-20 22:02:25.625970954 +0200 -+++ chromium-76.0.3809.100/remoting/signaling/message_tracker.h 2019-08-20 21:28:23.371952434 +0200 -@@ -36,7 +36,8 @@ class MessageTracker final { - - // All IDs older than now - kCleanupInterval will be eventually removed, but - // they are not guaranteed to be immediately removed after the interval. -- static const base::TimeDelta kCleanupInterval; -+ static constexpr base::TimeDelta kCleanupInterval = -+ base::TimeDelta::FromMinutes(2); - - void RemoveExpiredIds(); - -diff -up chromium-76.0.3809.100/remoting/signaling/message_tracker_unittest.cc.gcc-constexpr chromium-76.0.3809.100/remoting/signaling/message_tracker_unittest.cc diff --git a/chromium-76.0.3809.100-vtable-symbol-undefined.patch b/chromium-76.0.3809.100-vtable-symbol-undefined.patch deleted file mode 100644 index 64532df..0000000 --- a/chromium-76.0.3809.100-vtable-symbol-undefined.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up chromium-76.0.3809.100/net/quic/platform/impl/quic_default_proof_providers_impl.cc.vtable-symbol-undefined chromium-76.0.3809.100/net/quic/platform/impl/quic_default_proof_providers_impl.cc ---- chromium-76.0.3809.100/net/quic/platform/impl/quic_default_proof_providers_impl.cc.vtable-symbol-undefined 2019-08-20 21:21:24.901899270 +0200 -+++ chromium-76.0.3809.100/net/quic/platform/impl/quic_default_proof_providers_impl.cc 2019-08-20 21:19:30.361746211 +0200 -@@ -18,6 +18,7 @@ - #include "net/quic/crypto/proof_verifier_chromium.h" - #include "net/third_party/quiche/src/quic/platform/api/quic_flags.h" - #include "net/third_party/quiche/src/quic/platform/api/quic_ptr_util.h" -+#include "net/quic/platform/impl/quic_flags_impl.cc" - - DEFINE_QUIC_COMMAND_LINE_FLAG(std::string, - certificate_file, diff --git a/chromium-76.0.3809.132-chromedriver-zlib-fix.patch b/chromium-76.0.3809.132-chromedriver-zlib-fix.patch deleted file mode 100644 index f8b44d0..0000000 --- a/chromium-76.0.3809.132-chromedriver-zlib-fix.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up chromium-76.0.3809.132/chrome/test/chromedriver/BUILD.gn.fixme chromium-76.0.3809.132/chrome/test/chromedriver/BUILD.gn ---- chromium-76.0.3809.132/chrome/test/chromedriver/BUILD.gn.fixme 2019-09-10 15:53:02.871463568 -0400 -+++ chromium-76.0.3809.132/chrome/test/chromedriver/BUILD.gn 2019-09-10 16:57:32.281112323 -0400 -@@ -319,6 +319,7 @@ executable("chromedriver") { - "//net/server:http_server", - "//net/traffic_annotation:test_support", - "//services/network/public/mojom", -+ "//third_party/zlib", - ] - } - diff --git a/chromium-77-clang.patch b/chromium-77-clang.patch deleted file mode 100644 index a57b5a4..0000000 --- a/chromium-77-clang.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/base/location.h b/base/location.h -index c07e747..924db1c 100644 ---- a/base/location.h -+++ b/base/location.h -@@ -18,7 +18,7 @@ - - namespace base { - --#if defined(__has_builtin) -+#if defined(__clang__) - // Clang allows detection of these builtins. - #define SUPPORTS_LOCATION_BUILTINS \ - (__has_builtin(__builtin_FUNCTION) && __has_builtin(__builtin_FILE) && \ diff --git a/chromium-77.0.3865.75-base-gcc-no-alignas.patch b/chromium-77.0.3865.75-base-gcc-no-alignas.patch deleted file mode 100644 index 86a2271..0000000 --- a/chromium-77.0.3865.75-base-gcc-no-alignas.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up chromium-77.0.3865.75/base/task/promise/dependent_list.h.base-gcc-no-alignas chromium-77.0.3865.75/base/task/promise/dependent_list.h ---- chromium-77.0.3865.75/base/task/promise/dependent_list.h.base-gcc-no-alignas 2019-09-13 21:45:51.873172347 +0200 -+++ chromium-77.0.3865.75/base/task/promise/dependent_list.h 2019-09-13 21:46:21.661522514 +0200 -@@ -59,7 +59,7 @@ class BASE_EXPORT DependentList { - - // Align Node on an 8-byte boundary to ensure the first 3 bits are 0 and can - // be used to store additional state (see static_asserts below). -- class BASE_EXPORT alignas(8) Node { -+ class BASE_EXPORT ALIGNAS(8) Node { - public: - Node(); - explicit Node(Node&& other) noexcept; diff --git a/chromium-77.0.3865.75-certificate-transparency.patch b/chromium-77.0.3865.75-certificate-transparency.patch deleted file mode 100644 index 82e2958..0000000 --- a/chromium-77.0.3865.75-certificate-transparency.patch +++ /dev/null @@ -1,539 +0,0 @@ -diff -up chromium-77.0.3865.75/chrome/browser/net/system_network_context_manager_browsertest.cc.certificate-transparency chromium-77.0.3865.75/chrome/browser/net/system_network_context_manager_browsertest.cc ---- chromium-77.0.3865.75/chrome/browser/net/system_network_context_manager_browsertest.cc.certificate-transparency 2019-09-12 16:09:52.818635106 +0200 -+++ chromium-77.0.3865.75/chrome/browser/net/system_network_context_manager_browsertest.cc 2019-09-12 16:11:07.662562005 +0200 -@@ -21,6 +21,7 @@ - #include "components/version_info/version_info.h" - #include "content/public/common/content_switches.h" - #include "content/public/common/user_agent.h" -+#include "services/network/public/cpp/network_service_buildflags.h" - #include "services/network/public/mojom/network_context.mojom.h" - #include "services/network/public/mojom/network_service.mojom.h" - #include "testing/gmock/include/gmock/gmock.h" -@@ -356,3 +357,55 @@ IN_PROC_BROWSER_TEST_P(SystemNetworkCont - INSTANTIATE_TEST_SUITE_P(, - SystemNetworkContextManagerFreezeQUICUaBrowsertest, - ::testing::Values(true, false)); -+ -+class SystemNetworkContextManagerCertificateTransparencyBrowsertest -+ : public SystemNetworkContextManagerBrowsertest, -+ public testing::WithParamInterface> { -+ public: -+ SystemNetworkContextManagerCertificateTransparencyBrowsertest() { -+ SystemNetworkContextManager::SetEnableCertificateTransparencyForTesting( -+ GetParam()); -+ } -+ ~SystemNetworkContextManagerCertificateTransparencyBrowsertest() override { -+ SystemNetworkContextManager::SetEnableCertificateTransparencyForTesting( -+ base::nullopt); -+ } -+}; -+ -+#if BUILDFLAG(IS_CT_SUPPORTED) -+IN_PROC_BROWSER_TEST_P( -+ SystemNetworkContextManagerCertificateTransparencyBrowsertest, -+ CertificateTransparencyConfig) { -+ network::mojom::NetworkContextParamsPtr context_params = -+ g_browser_process->system_network_context_manager() -+ ->CreateDefaultNetworkContextParams(); -+ -+ const bool kDefault = -+#if defined(GOOGLE_CHROME_BUILD) && defined(OFFICIAL_BUILD) && \ -+ !defined(OS_ANDROID) -+ true; -+#else -+ false; -+#endif -+ -+ EXPECT_EQ(GetParam().value_or(kDefault), -+ context_params->enforce_chrome_ct_policy); -+ EXPECT_NE(GetParam().value_or(kDefault), context_params->ct_logs.empty()); -+ -+ if (GetParam().value_or(kDefault)) { -+ bool has_google_log = false; -+ bool has_disqualified_log = false; -+ for (const auto& ct_log : context_params->ct_logs) { -+ has_google_log |= ct_log->operated_by_google; -+ has_disqualified_log |= ct_log->disqualified_at.has_value(); -+ } -+ EXPECT_TRUE(has_google_log); -+ EXPECT_TRUE(has_disqualified_log); -+ } -+} -+#endif -+ -+INSTANTIATE_TEST_SUITE_P( -+ , -+ SystemNetworkContextManagerCertificateTransparencyBrowsertest, -+ ::testing::Values(base::nullopt, true, false)); -diff -up chromium-77.0.3865.75/chrome/browser/net/system_network_context_manager.cc.certificate-transparency chromium-77.0.3865.75/chrome/browser/net/system_network_context_manager.cc ---- chromium-77.0.3865.75/chrome/browser/net/system_network_context_manager.cc.certificate-transparency 2019-09-09 23:55:09.000000000 +0200 -+++ chromium-77.0.3865.75/chrome/browser/net/system_network_context_manager.cc 2019-09-12 16:09:52.819635118 +0200 -@@ -4,11 +4,13 @@ - - #include "chrome/browser/net/system_network_context_manager.h" - -+#include - #include - #include - #include - - #include "base/bind.h" -+#include "base/build_time.h" - #include "base/command_line.h" - #include "base/feature_list.h" - #include "base/logging.h" -@@ -50,6 +52,7 @@ - #include "content/public/common/mime_handler_view_mode.h" - #include "content/public/common/service_names.mojom.h" - #include "content/public/common/user_agent.h" -+#include "crypto/sha2.h" - #include "mojo/public/cpp/bindings/associated_interface_ptr.h" - #include "net/dns/public/util.h" - #include "net/net_buildflags.h" -@@ -79,6 +82,20 @@ - - namespace { - -+constexpr bool kCertificateTransparencyEnabled = -+#if defined(GOOGLE_CHROME_BUILD) && defined(OFFICIAL_BUILD) && \ -+ !defined(OS_ANDROID) -+ // Certificate Transparency is only enabled if: -+ // - Desktop (!OS_ANDROID); OS_IOS does not use this file -+ // - base::GetBuildTime() is deterministic to the source (OFFICIAL_BUILD) -+ // - The build in reliably updatable (GOOGLE_CHROME_BUILD) -+ true; -+#else -+ false; -+#endif -+ -+bool g_enable_certificate_transparency = kCertificateTransparencyEnabled; -+ - // The global instance of the SystemNetworkContextmanager. - SystemNetworkContextManager* g_system_network_context_manager = nullptr; - -@@ -658,14 +675,35 @@ SystemNetworkContextManager::CreateDefau - - bool http_09_on_non_default_ports_enabled = false; - #if !defined(OS_ANDROID) -- // CT is only enabled on Desktop platforms for now. -- network_context_params->enforce_chrome_ct_policy = true; -- for (const auto& ct_log : certificate_transparency::GetKnownLogs()) { -- // TODO(rsleevi): https://crbug.com/702062 - Remove this duplication. -- network::mojom::CTLogInfoPtr log_info = network::mojom::CTLogInfo::New(); -- log_info->public_key = std::string(ct_log.log_key, ct_log.log_key_length); -- log_info->name = ct_log.log_name; -- network_context_params->ct_logs.push_back(std::move(log_info)); -+ -+ if (g_enable_certificate_transparency) { -+ network_context_params->enforce_chrome_ct_policy = true; -+ network_context_params->ct_log_update_time = base::GetBuildTime(); -+ -+ std::vector operated_by_google_logs = -+ certificate_transparency::GetLogsOperatedByGoogle(); -+ std::vector> disqualified_logs = -+ certificate_transparency::GetDisqualifiedLogs(); -+ for (const auto& ct_log : certificate_transparency::GetKnownLogs()) { -+ // TODO(rsleevi): https://crbug.com/702062 - Remove this duplication. -+ network::mojom::CTLogInfoPtr log_info = network::mojom::CTLogInfo::New(); -+ log_info->public_key = std::string(ct_log.log_key, ct_log.log_key_length); -+ log_info->name = ct_log.log_name; -+ -+ std::string log_id = crypto::SHA256HashString(log_info->public_key); -+ log_info->operated_by_google = -+ std::binary_search(std::begin(operated_by_google_logs), -+ std::end(operated_by_google_logs), log_id); -+ auto it = std::lower_bound( -+ std::begin(disqualified_logs), std::end(disqualified_logs), log_id, -+ [](const auto& disqualified_log, const std::string& log_id) { -+ return disqualified_log.first < log_id; -+ }); -+ if (it != std::end(disqualified_logs) && it->first == log_id) { -+ log_info->disqualified_at = it->second; -+ } -+ network_context_params->ct_logs.push_back(std::move(log_info)); -+ } - } - - const base::Value* value = -@@ -723,6 +761,12 @@ SystemNetworkContextManager::GetHttpAuth - return CreateHttpAuthDynamicParams(g_browser_process->local_state()); - } - -+void SystemNetworkContextManager::SetEnableCertificateTransparencyForTesting( -+ base::Optional enabled) { -+ g_enable_certificate_transparency = -+ enabled.value_or(kCertificateTransparencyEnabled); -+} -+ - network::mojom::NetworkContextParamsPtr - SystemNetworkContextManager::CreateNetworkContextParams() { - // TODO(mmenke): Set up parameters here (in memory cookie store, etc). -diff -up chromium-77.0.3865.75/chrome/browser/net/system_network_context_manager.h.certificate-transparency chromium-77.0.3865.75/chrome/browser/net/system_network_context_manager.h ---- chromium-77.0.3865.75/chrome/browser/net/system_network_context_manager.h.certificate-transparency 2019-09-09 23:55:09.000000000 +0200 -+++ chromium-77.0.3865.75/chrome/browser/net/system_network_context_manager.h 2019-09-12 16:09:52.819635118 +0200 -@@ -139,6 +139,12 @@ class SystemNetworkContextManager { - static network::mojom::HttpAuthDynamicParamsPtr - GetHttpAuthDynamicParamsForTesting(); - -+ // Enables Certificate Transparency and enforcing the Chrome Certificate -+ // Transparency Policy. For test use only. Use base::nullopt_t to reset to -+ // the default state. -+ static void SetEnableCertificateTransparencyForTesting( -+ base::Optional enabled); -+ - private: - class URLLoaderFactoryForSystem; - -diff -up chromium-77.0.3865.75/chrome/browser/policy/policy_browsertest.cc.certificate-transparency chromium-77.0.3865.75/chrome/browser/policy/policy_browsertest.cc ---- chromium-77.0.3865.75/chrome/browser/policy/policy_browsertest.cc.certificate-transparency 2019-09-09 23:55:10.000000000 +0200 -+++ chromium-77.0.3865.75/chrome/browser/policy/policy_browsertest.cc 2019-09-12 16:09:52.820635131 +0200 -@@ -4836,7 +4836,7 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, - browser()->tab_strip_model()->GetActiveWebContents()->GetTitle()); - } - --IN_PROC_BROWSER_TEST_F(PolicyTest, -+IN_PROC_BROWSER_TEST_F(CertificateTransparencyPolicyTest, - CertificateTransparencyEnforcementDisabledForCas) { - net::EmbeddedTestServer https_server_ok(net::EmbeddedTestServer::TYPE_HTTPS); - https_server_ok.SetSSLConfig(net::EmbeddedTestServer::CERT_OK); -diff -up chromium-77.0.3865.75/chrome/browser/ssl/chrome_expect_ct_reporter_browsertest.cc.certificate-transparency chromium-77.0.3865.75/chrome/browser/ssl/chrome_expect_ct_reporter_browsertest.cc ---- chromium-77.0.3865.75/chrome/browser/ssl/chrome_expect_ct_reporter_browsertest.cc.certificate-transparency 2019-09-09 23:55:10.000000000 +0200 -+++ chromium-77.0.3865.75/chrome/browser/ssl/chrome_expect_ct_reporter_browsertest.cc 2019-09-12 16:09:52.821635143 +0200 -@@ -8,6 +8,7 @@ - #include "base/callback.h" - #include "base/run_loop.h" - #include "base/test/scoped_feature_list.h" -+#include "chrome/browser/net/system_network_context_manager.h" - #include "chrome/browser/profiles/profile.h" - #include "chrome/browser/ssl/cert_verifier_browser_test.h" - #include "chrome/browser/ui/browser.h" -@@ -27,7 +28,17 @@ namespace { - // received by a server. - class ExpectCTBrowserTest : public CertVerifierBrowserTest { - public: -- ExpectCTBrowserTest() : CertVerifierBrowserTest() {} -+ ExpectCTBrowserTest() : CertVerifierBrowserTest() { -+ // Expect-CT reporting depends on actually enforcing Certificate -+ // Transparency. -+ SystemNetworkContextManager::SetEnableCertificateTransparencyForTesting( -+ true); -+ } -+ -+ ~ExpectCTBrowserTest() override { -+ SystemNetworkContextManager::SetEnableCertificateTransparencyForTesting( -+ base::nullopt); -+ } - - void SetUpOnMainThread() override { - run_loop_ = std::make_unique(); -diff -up chromium-77.0.3865.75/chrome/browser/ssl/security_state_tab_helper_browsertest.cc.certificate-transparency chromium-77.0.3865.75/chrome/browser/ssl/security_state_tab_helper_browsertest.cc ---- chromium-77.0.3865.75/chrome/browser/ssl/security_state_tab_helper_browsertest.cc.certificate-transparency 2019-09-09 23:55:10.000000000 +0200 -+++ chromium-77.0.3865.75/chrome/browser/ssl/security_state_tab_helper_browsertest.cc 2019-09-12 16:09:52.821635143 +0200 -@@ -433,6 +433,13 @@ class SecurityStateTabHelperTest : publi - SecurityStateTabHelperTest() - : https_server_(net::EmbeddedTestServer::TYPE_HTTPS) { - https_server_.ServeFilesFromSourceDirectory(GetChromeTestDataDir()); -+ SystemNetworkContextManager::SetEnableCertificateTransparencyForTesting( -+ true); -+ } -+ -+ ~SecurityStateTabHelperTest() override { -+ SystemNetworkContextManager::SetEnableCertificateTransparencyForTesting( -+ base::nullopt); - } - - void SetUpOnMainThread() override { -diff -up chromium-77.0.3865.75/chrome/browser/ssl/ssl_browsertest.cc.certificate-transparency chromium-77.0.3865.75/chrome/browser/ssl/ssl_browsertest.cc ---- chromium-77.0.3865.75/chrome/browser/ssl/ssl_browsertest.cc.certificate-transparency 2019-09-09 23:55:10.000000000 +0200 -+++ chromium-77.0.3865.75/chrome/browser/ssl/ssl_browsertest.cc 2019-09-12 16:09:52.822635155 +0200 -@@ -1853,8 +1853,14 @@ class CertificateTransparencySSLUITest : - public: - CertificateTransparencySSLUITest() - : CertVerifierBrowserTest(), -- https_server_(net::EmbeddedTestServer::TYPE_HTTPS) {} -- ~CertificateTransparencySSLUITest() override {} -+ https_server_(net::EmbeddedTestServer::TYPE_HTTPS) { -+ SystemNetworkContextManager::SetEnableCertificateTransparencyForTesting( -+ true); -+ } -+ ~CertificateTransparencySSLUITest() override { -+ SystemNetworkContextManager::SetEnableCertificateTransparencyForTesting( -+ base::nullopt); -+ } - - void SetUpOnMainThread() override { - CertVerifierBrowserTest::SetUpOnMainThread(); -diff -up chromium-77.0.3865.75/components/certificate_transparency/chrome_ct_policy_enforcer.h.certificate-transparency chromium-77.0.3865.75/components/certificate_transparency/chrome_ct_policy_enforcer.h ---- chromium-77.0.3865.75/components/certificate_transparency/chrome_ct_policy_enforcer.h.certificate-transparency 2019-09-09 23:55:14.000000000 +0200 -+++ chromium-77.0.3865.75/components/certificate_transparency/chrome_ct_policy_enforcer.h 2019-09-12 16:09:52.823635168 +0200 -@@ -45,6 +45,19 @@ class ChromeCTPolicyEnforcer : public ne - - void SetClockForTesting(const base::Clock* clock) { clock_ = clock; } - -+ // TODO(https://crbug.com/999240): These are exposed to allow end-to-end -+ // testing by higher layers (i.e. that the ChromeCTPolicyEnforcer is -+ // correctly constructed). When either this issue or https://crbug.com/848277 -+ // are fixed, the configuration can be tested independently, and these can -+ // be removed. -+ const std::vector& operated_by_google_logs_for_testing() { -+ return operated_by_google_logs_; -+ } -+ const std::vector>& -+ disqualified_logs_for_testing() { -+ return disqualified_logs_; -+ } -+ - private: - // Returns true if the log identified by |log_id| (the SHA-256 hash of the - // log's DER-encoded SPKI) has been disqualified, and sets -diff -up chromium-77.0.3865.75/services/network/network_context.cc.certificate-transparency chromium-77.0.3865.75/services/network/network_context.cc ---- chromium-77.0.3865.75/services/network/network_context.cc.certificate-transparency 2019-09-09 23:55:22.000000000 +0200 -+++ chromium-77.0.3865.75/services/network/network_context.cc 2019-09-12 16:09:52.823635168 +0200 -@@ -36,6 +36,7 @@ - #include "components/prefs/pref_registry_simple.h" - #include "components/prefs/pref_service.h" - #include "components/prefs/pref_service_factory.h" -+#include "crypto/sha2.h" - #include "mojo/public/cpp/bindings/strong_binding.h" - #include "net/base/layered_network_delegate.h" - #include "net/base/load_flags.h" -@@ -1877,16 +1878,6 @@ URLRequestContextOwner NetworkContext::A - base::FeatureList::IsEnabled(features::kNetworkErrorLogging)); - #endif // BUILDFLAG(ENABLE_REPORTING) - --#if BUILDFLAG(IS_CT_SUPPORTED) -- if (params_->enforce_chrome_ct_policy) { -- builder->set_ct_policy_enforcer( -- std::make_unique( -- base::GetBuildTime(), -- certificate_transparency::GetDisqualifiedLogs(), -- certificate_transparency::GetLogsOperatedByGoogle())); -- } --#endif // BUILDFLAG(IS_CT_SUPPORTED) -- - net::HttpNetworkSession::Params session_params; - bool is_quic_force_disabled = false; - if (network_service_ && network_service_->quic_disabled()) -@@ -1936,8 +1927,20 @@ URLRequestContextOwner NetworkContext::A - - #if BUILDFLAG(IS_CT_SUPPORTED) - std::vector> ct_logs; -+ std::vector> disqualified_logs; -+ std::vector operated_by_google_logs; -+ - if (!params_->ct_logs.empty()) { - for (const auto& log : params_->ct_logs) { -+ if (log->operated_by_google || log->disqualified_at) { -+ std::string log_id = crypto::SHA256HashString(log->public_key); -+ if (log->operated_by_google) -+ operated_by_google_logs.push_back(log_id); -+ if (log->disqualified_at) { -+ disqualified_logs.push_back( -+ std::make_pair(log_id, log->disqualified_at.value())); -+ } -+ } - scoped_refptr log_verifier = - net::CTLogVerifier::Create(log->public_key, log->name); - if (!log_verifier) { -@@ -1950,6 +1953,17 @@ URLRequestContextOwner NetworkContext::A - ct_verifier->AddLogs(ct_logs); - builder->set_ct_verifier(std::move(ct_verifier)); - } -+ -+ if (params_->enforce_chrome_ct_policy) { -+ std::sort(std::begin(operated_by_google_logs), -+ std::end(operated_by_google_logs)); -+ std::sort(std::begin(disqualified_logs), std::end(disqualified_logs)); -+ -+ builder->set_ct_policy_enforcer( -+ std::make_unique( -+ params_->ct_log_update_time, disqualified_logs, -+ operated_by_google_logs)); -+ } - #endif // BUILDFLAG(IS_CT_SUPPORTED) - - const base::CommandLine* command_line = -diff -up chromium-77.0.3865.75/services/network/network_context_unittest.cc.certificate-transparency chromium-77.0.3865.75/services/network/network_context_unittest.cc ---- chromium-77.0.3865.75/services/network/network_context_unittest.cc.certificate-transparency 2019-09-09 23:55:22.000000000 +0200 -+++ chromium-77.0.3865.75/services/network/network_context_unittest.cc 2019-09-12 16:13:10.479056669 +0200 -@@ -2,6 +2,7 @@ - // Use of this source code is governed by a BSD-style license that can be - // found in the LICENSE file. - -+#include - #include - #include - #include -@@ -38,10 +39,12 @@ - #include "base/threading/thread_task_runner_handle.h" - #include "base/time/default_clock.h" - #include "base/time/default_tick_clock.h" -+#include "base/time/time.h" - #include "build/build_config.h" - #include "components/network_session_configurator/browser/network_session_configurator.h" - #include "components/network_session_configurator/common/network_switches.h" - #include "components/prefs/testing_pref_service.h" -+#include "crypto/sha2.h" - #include "mojo/public/cpp/bindings/remote.h" - #include "mojo/public/cpp/bindings/self_owned_receiver.h" - #include "mojo/public/cpp/system/data_pipe_utils.h" -@@ -115,6 +118,11 @@ - #include "url/scheme_host_port.h" - #include "url/url_constants.h" - -+#if BUILDFLAG(IS_CT_SUPPORTED) -+#include "components/certificate_transparency/chrome_ct_policy_enforcer.h" -+#include "services/network/public/mojom/ct_log_info.mojom.h" -+#endif -+ - #if !BUILDFLAG(DISABLE_FTP_SUPPORT) - #include "net/ftp/ftp_auth_cache.h" - #endif // !BUILDFLAG(DISABLE_FTP_SUPPORT) -@@ -5958,6 +5966,72 @@ TEST_F(NetworkContextSplitCacheTest, - true /* was_cached */, true /* is_navigation */); - } - -+#if BUILDFLAG(IS_CT_SUPPORTED) -+TEST_F(NetworkContextTest, CertificateTransparencyConfig) { -+ mojom::NetworkContextParamsPtr params = CreateContextParams(); -+ params->enforce_chrome_ct_policy = true; -+ params->ct_log_update_time = base::Time::Now(); -+ -+ // The log public keys do not matter for the test, so invalid keys are used. -+ // However, because the log IDs are derived from the SHA-256 hash of the log -+ // key, the log keys are generated such that qualified logs are in the form -+ // of four digits (e.g. "0000", "1111"), while disqualified logs are in the -+ // form of four letters (e.g. "AAAA", "BBBB"). -+ -+ for (int i = 0; i < 6; ++i) { -+ network::mojom::CTLogInfoPtr log_info = network::mojom::CTLogInfo::New(); -+ // Shift to ASCII '0' (0x30) -+ log_info->public_key = std::string(4, 0x30 + static_cast(i)); -+ log_info->name = std::string(4, 0x30 + static_cast(i)); -+ log_info->operated_by_google = i % 2; -+ -+ params->ct_logs.push_back(std::move(log_info)); -+ } -+ for (int i = 0; i < 3; ++i) { -+ network::mojom::CTLogInfoPtr log_info = network::mojom::CTLogInfo::New(); -+ // Shift to ASCII 'A' (0x41) -+ log_info->public_key = std::string(4, 0x41 + static_cast(i)); -+ log_info->name = std::string(4, 0x41 + static_cast(i)); -+ log_info->operated_by_google = false; -+ log_info->disqualified_at = base::TimeDelta::FromSeconds(i); -+ -+ params->ct_logs.push_back(std::move(log_info)); -+ } -+ std::unique_ptr network_context = -+ CreateContextWithParams(std::move(params)); -+ -+ net::CTPolicyEnforcer* request_enforcer = -+ network_context->url_request_context()->ct_policy_enforcer(); -+ ASSERT_TRUE(request_enforcer); -+ -+ // Completely unsafe if |enforce_chrome_ct_policy| is false. -+ certificate_transparency::ChromeCTPolicyEnforcer* policy_enforcer = -+ reinterpret_cast( -+ request_enforcer); -+ -+ EXPECT_TRUE(std::is_sorted( -+ policy_enforcer->operated_by_google_logs_for_testing().begin(), -+ policy_enforcer->operated_by_google_logs_for_testing().end())); -+ EXPECT_TRUE( -+ std::is_sorted(policy_enforcer->disqualified_logs_for_testing().begin(), -+ policy_enforcer->disqualified_logs_for_testing().end())); -+ -+ EXPECT_THAT( -+ policy_enforcer->operated_by_google_logs_for_testing(), -+ ::testing::UnorderedElementsAreArray({crypto::SHA256HashString("1111"), -+ crypto::SHA256HashString("3333"), -+ crypto::SHA256HashString("5555")})); -+ EXPECT_THAT(policy_enforcer->disqualified_logs_for_testing(), -+ ::testing::UnorderedElementsAre( -+ ::testing::Pair(crypto::SHA256HashString("AAAA"), -+ base::TimeDelta::FromSeconds(0)), -+ ::testing::Pair(crypto::SHA256HashString("BBBB"), -+ base::TimeDelta::FromSeconds(1)), -+ ::testing::Pair(crypto::SHA256HashString("CCCC"), -+ base::TimeDelta::FromSeconds(2)))); -+} -+#endif -+ - } // namespace - - } // namespace network -diff -up chromium-77.0.3865.75/services/network/public/mojom/ct_log_info.mojom.certificate-transparency chromium-77.0.3865.75/services/network/public/mojom/ct_log_info.mojom ---- chromium-77.0.3865.75/services/network/public/mojom/ct_log_info.mojom.certificate-transparency 2019-09-09 23:55:22.000000000 +0200 -+++ chromium-77.0.3865.75/services/network/public/mojom/ct_log_info.mojom 2019-09-12 16:09:52.824635180 +0200 -@@ -4,6 +4,8 @@ - - module network.mojom; - -+import "mojo/public/mojom/base/time.mojom"; -+ - // A single Certificate Transparency Log configuration. - struct CTLogInfo { - // The DER-encoded SubjectPublicKeyInfo of the log. -@@ -14,4 +16,13 @@ struct CTLogInfo { - // The human-readable, log-supplied log name. Note that this will not be - // translated. - string name; -+ -+ // Whether or not the log should should be considered a Google Log for the -+ // purposes of enforcing the "Certificate Transparency in Chrome" policy. -+ bool operated_by_google = false; -+ -+ // If set, the time since the Unix Epoch when the log was disqualified. This -+ // is used to determine the "once or currently qualified" status of the log. -+ // If the log is currently qualified, this will not be set. -+ mojo_base.mojom.TimeDelta? disqualified_at; - }; -diff -up chromium-77.0.3865.75/services/network/public/mojom/network_context.mojom.certificate-transparency chromium-77.0.3865.75/services/network/public/mojom/network_context.mojom ---- chromium-77.0.3865.75/services/network/public/mojom/network_context.mojom.certificate-transparency 2019-09-09 23:55:22.000000000 +0200 -+++ chromium-77.0.3865.75/services/network/public/mojom/network_context.mojom 2019-09-12 16:09:52.825635192 +0200 -@@ -239,15 +239,6 @@ struct NetworkContextParams { - [EnableIf=is_android] - bool check_clear_text_permitted = false; - -- // True if the "Certificate Transparency in Chrome" policy (see -- // https://github.com/chromium/ct-policy/blob/master/ct_policy.md) should -- // be enforced for certificates and connections. -- // -- // See //net/docs/certificate-transparency.md before setting this flag to -- // true. -- [EnableIf=is_ct_supported] -- bool enforce_chrome_ct_policy = false; -- - // Enables HTTP/0.9 on ports other than 80 for HTTP and 443 for HTTPS. - bool http_09_on_non_default_ports_enabled = false; - -@@ -300,6 +291,15 @@ struct NetworkContextParams { - // servers, so they can discover misconfigurations. - bool enable_certificate_reporting = false; - -+ // True if the "Certificate Transparency in Chrome" policy (see -+ // https://github.com/chromium/ct-policy/blob/master/ct_policy.md) should -+ // be enforced for certificates and connections. -+ // -+ // See //net/docs/certificate-transparency.md before setting this flag to -+ // true. -+ [EnableIf=is_ct_supported] -+ bool enforce_chrome_ct_policy = false; -+ - // Enables Expect CT reporting, which sends reports for opted-in sites that - // don't serve sufficient Certificate Transparency information. - [EnableIf=is_ct_supported] -@@ -311,6 +311,13 @@ struct NetworkContextParams { - [EnableIf=is_ct_supported] - array ct_logs; - -+ // When the Certificate Transparency logs in |ct_logs| were last updated. If -+ // |enforce_chrome_ct_policy| is set, and |ct_log_update_time| is not -+ // sufficiently recent, enforcement of the "Certificate Transparency in -+ // Chrome" policy will be disabled. -+ [EnableIf=is_ct_supported] -+ mojo_base.mojom.Time ct_log_update_time; -+ - // Specifies the path to the directory where NSS will store its database. - [EnableIf=is_chromeos] - mojo_base.mojom.FilePath? nss_path; diff --git a/chromium-77.0.3865.75-gcc-abstract-class.patch b/chromium-77.0.3865.75-gcc-abstract-class.patch deleted file mode 100644 index 6d77299..0000000 --- a/chromium-77.0.3865.75-gcc-abstract-class.patch +++ /dev/null @@ -1,61 +0,0 @@ -From f08cb0022527081c078e8b96062e6c9b4fbda151 Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Fri, 26 Jul 2019 16:48:06 +0000 -Subject: [PATCH] BinaryUploadService: change parameter passing that cannot afford abstract class - -The method UploadForDeepScanning gets a Request as parameter. But Request is an -abstract class, so GCC will not allow that declaration (polimorphycs should be -passed by reference). Use std::unique_ptr so BinaryUploadService can assume -ownership. - -Bug: 819294 -Change-Id: I9e8c75cc92b01abd704d9049b0421555377da5ba -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1713550 -Reviewed-by: Daniel Rubery -Commit-Queue: José Dapena Paz -Cr-Commit-Position: refs/heads/master@{#681333} ---- - -diff --git a/chrome/browser/safe_browsing/download_protection/binary_upload_service.cc b/chrome/browser/safe_browsing/download_protection/binary_upload_service.cc -index 6430c89..4e90487 100644 ---- a/chrome/browser/safe_browsing/download_protection/binary_upload_service.cc -+++ b/chrome/browser/safe_browsing/download_protection/binary_upload_service.cc -@@ -10,7 +10,7 @@ - namespace safe_browsing { - - void BinaryUploadService::UploadForDeepScanning( -- BinaryUploadService::Request request) { -+ std::unique_ptr request) { - DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - NOTREACHED(); - } -diff --git a/chrome/browser/safe_browsing/download_protection/binary_upload_service.h b/chrome/browser/safe_browsing/download_protection/binary_upload_service.h -index d2dfd83..9b6f395 100644 ---- a/chrome/browser/safe_browsing/download_protection/binary_upload_service.h -+++ b/chrome/browser/safe_browsing/download_protection/binary_upload_service.h -@@ -5,6 +5,8 @@ - #ifndef CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_BINARY_UPLOAD_SERVICE_H_ - #define CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_BINARY_UPLOAD_SERVICE_H_ - -+#include -+ - #include "base/callback.h" - #include "components/safe_browsing/proto/webprotect.pb.h" - -@@ -40,6 +42,7 @@ - public: - // |callback| will run on the UI thread. - explicit Request(Callback callback); -+ virtual ~Request() = default; - Request(const Request&) = delete; - Request& operator=(const Request&) = delete; - -@@ -67,7 +70,7 @@ - // Upload the given file contents for deep scanning. The results will be - // returned asynchronously by calling |request|'s |callback|. This must be - // called on the UI thread. -- void UploadForDeepScanning(Request request); -+ void UploadForDeepScanning(std::unique_ptr request); - }; - - } // namespace safe_browsing diff --git a/chromium-77.0.3865.75-harfbuzz-subset.patch b/chromium-77.0.3865.75-harfbuzz-subset.patch deleted file mode 100644 index 55d78d1..0000000 --- a/chromium-77.0.3865.75-harfbuzz-subset.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 27e25336b8316ff3ec4e464058682ed85801fd06 Mon Sep 17 00:00:00 2001 -From: Raphael Kubo da Costa -Date: Mon, 29 Jul 2019 10:54:28 +0000 -Subject: [PATCH] Also link against libharfbuzz-subset when use_system_harfbuzz is true - -When building HarfBuzz as part of Chromium, there is a single source set -with all the files we need in the build. - -Upstream HarfBuzz, on the other hand, produces a few different libraries: -harfbuzz, harfbuzz-icu and harfbuzz-subset. When |use_system_harfbuzz| is -true, we were only looking for (and using) harfbuzz.pc with pkg-config even -though we also use symbols from libharfbuzz-subset.so. This resulted in -errors when linking: - - ld: obj/skia/skia/SkPDFSubsetFont.o: in function `SkPDFSubsetFont(sk_sp, SkPDFGlyphUse const&, SkPDF::Metadata::Subsetter, char const*, int)': - SkPDFSubsetFont.cpp:(.text._Z15SkPDFSubsetFont5sk_spI6SkDataERK13SkPDFGlyphUseN5SkPDF8Metadata9SubsetterEPKci+0x48a): undefined reference to `hb_subset_input_create_or_fail' - ld: SkPDFSubsetFont.cpp:(.text._Z15SkPDFSubsetFont5sk_spI6SkDataERK13SkPDFGlyphUseN5SkPDF8Metadata9SubsetterEPKci+0x4af): undefined reference to `hb_subset_input_glyph_set' - ld: SkPDFSubsetFont.cpp:(.text._Z15SkPDFSubsetFont5sk_spI6SkDataERK13SkPDFGlyphUseN5SkPDF8Metadata9SubsetterEPKci+0x5d7): undefined reference to `hb_subset_input_set_retain_gids' - ld: SkPDFSubsetFont.cpp:(.text._Z15SkPDFSubsetFont5sk_spI6SkDataERK13SkPDFGlyphUseN5SkPDF8Metadata9SubsetterEPKci+0x5e4): undefined reference to `hb_subset_input_set_drop_hints' - ld: SkPDFSubsetFont.cpp:(.text._Z15SkPDFSubsetFont5sk_spI6SkDataERK13SkPDFGlyphUseN5SkPDF8Metadata9SubsetterEPKci+0x5f3): undefined reference to `hb_subset' - ld: SkPDFSubsetFont.cpp:(.text._Z15SkPDFSubsetFont5sk_spI6SkDataERK13SkPDFGlyphUseN5SkPDF8Metadata9SubsetterEPKci+0x66f): undefined reference to `hb_subset_input_destroy' - -as reported in -https://groups.google.com/a/chromium.org/d/msg/chromium-packagers/UyJsVJ5QqWo/jSv5z7-rEQAJ - -Change-Id: I997af075c7b7263cd7cc71a63db5b0f93bd1ab59 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1715288 -Auto-Submit: Raphael Kubo da Costa -Commit-Queue: Dominik Röttsches -Reviewed-by: Dominik Röttsches -Cr-Commit-Position: refs/heads/master@{#681760} ---- - -diff --git a/third_party/harfbuzz-ng/BUILD.gn b/third_party/harfbuzz-ng/BUILD.gn -index 37d8e33..72013eb1d 100644 ---- a/third_party/harfbuzz-ng/BUILD.gn -+++ b/third_party/harfbuzz-ng/BUILD.gn -@@ -16,7 +16,10 @@ - "//third_party:freetype_harfbuzz", - "//third_party/freetype:freetype_source", - ] -- packages = [ "harfbuzz" ] -+ packages = [ -+ "harfbuzz", -+ "harfbuzz-subset", -+ ] - } - } else { - config("harfbuzz_config") { diff --git a/chromium-77.0.3865.75-missing-limits.patch b/chromium-77.0.3865.75-missing-limits.patch deleted file mode 100644 index 3ac1770..0000000 --- a/chromium-77.0.3865.75-missing-limits.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 5baf7df7f4c5971dab552897eeef94b194650ce5 Mon Sep 17 00:00:00 2001 -From: Dave Tapuska -Date: Mon, 12 Aug 2019 22:30:13 +0000 -Subject: [PATCH] Fix build failure due to missing include for std::numeric_limits usage. - -Some configurations fail to build, limits should have been included. - -BUG=992832 - -Change-Id: I894ba0543bfcef101c93259e39a31d12ae6d035c -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1747981 -Commit-Queue: Dave Tapuska -Reviewed-by: Mostyn Bramley-Moore -Cr-Commit-Position: refs/heads/master@{#686214} ---- - -diff --git a/third_party/blink/renderer/platform/exported/web_time_range.cc b/third_party/blink/renderer/platform/exported/web_time_range.cc -index 384566a..68d83e1 100644 ---- a/third_party/blink/renderer/platform/exported/web_time_range.cc -+++ b/third_party/blink/renderer/platform/exported/web_time_range.cc -@@ -31,6 +31,7 @@ - #include "third_party/blink/public/platform/web_time_range.h" - - #include -+#include - - namespace blink { - diff --git a/chromium-77.0.3865.75-unbundle-zlib.patch b/chromium-77.0.3865.75-unbundle-zlib.patch deleted file mode 100644 index d6c45ad..0000000 --- a/chromium-77.0.3865.75-unbundle-zlib.patch +++ /dev/null @@ -1,25 +0,0 @@ -From e1bbdec720a333937bd1b990ae0f7ee97db0d3b0 Mon Sep 17 00:00:00 2001 -From: Your Name -Date: Fri, 28 Jun 2019 15:56:23 +0000 -Subject: [PATCH] update zlib - ---- - third_party/perfetto/gn/BUILD.gn | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/third_party/perfetto/gn/BUILD.gn b/third_party/perfetto/gn/BUILD.gn -index c951f5f..297eee3 100644 ---- a/third_party/perfetto/gn/BUILD.gn -+++ b/third_party/perfetto/gn/BUILD.gn -@@ -200,7 +200,7 @@ group("zlib") { - "//buildtools:zlib", - ] - } else if (build_with_chromium) { -- public_configs = [ "//third_party/zlib:zlib_config" ] -+ public_configs = [ "//third_party/zlib:system_zlib" ] - public_deps = [ - "//third_party/zlib", - ] --- -2.21.0 - diff --git a/chromium-77.0.3865.90-linked-hash-set.patch b/chromium-77.0.3865.90-linked-hash-set.patch deleted file mode 100644 index f921f1a..0000000 --- a/chromium-77.0.3865.90-linked-hash-set.patch +++ /dev/null @@ -1,130 +0,0 @@ -From 74138b9febd37eac0fc26b8efb110014a83a52c6 Mon Sep 17 00:00:00 2001 -From: Jeremy Roman -Date: Wed, 07 Aug 2019 13:26:48 +0000 -Subject: [PATCH] WTF: Make LinkedHashSet understand values for which memset initialization would be bad. - -Includes a unit test which fails before, and uses this to fix FontCacheKeyTraits. - -Bug: 980025 -Change-Id: If41f97444c7fd37b9b95d6dadaf3da5689079e9e -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1739948 -Reviewed-by: Kentaro Hara -Reviewed-by: Yutaka Hirano -Commit-Queue: Jeremy Roman -Cr-Commit-Position: refs/heads/master@{#684731} ---- - -diff --git a/third_party/blink/renderer/platform/fonts/font_cache_key.h b/third_party/blink/renderer/platform/fonts/font_cache_key.h -index 0efc8fb..90063cb 100644 ---- a/third_party/blink/renderer/platform/fonts/font_cache_key.h -+++ b/third_party/blink/renderer/platform/fonts/font_cache_key.h -@@ -133,6 +133,10 @@ - - struct FontCacheKeyTraits : WTF::SimpleClassHashTraits { - STATIC_ONLY(FontCacheKeyTraits); -+ -+ // std::string's empty state need not be zero in all implementations, -+ // and it is held within FontFaceCreationParams. -+ static const bool kEmptyValueIsZero = false; - }; - - } // namespace blink -diff --git a/third_party/blink/renderer/platform/wtf/linked_hash_set.h b/third_party/blink/renderer/platform/wtf/linked_hash_set.h -index b35b6e9..77e524c 100644 ---- a/third_party/blink/renderer/platform/wtf/linked_hash_set.h -+++ b/third_party/blink/renderer/platform/wtf/linked_hash_set.h -@@ -146,6 +146,11 @@ - LinkedHashSetNodeBase* next) - : LinkedHashSetNodeBase(prev, next), value_(value) {} - -+ LinkedHashSetNode(ValueArg&& value, -+ LinkedHashSetNodeBase* prev, -+ LinkedHashSetNodeBase* next) -+ : LinkedHashSetNodeBase(prev, next), value_(std::move(value)) {} -+ - LinkedHashSetNode(LinkedHashSetNode&& other) - : LinkedHashSetNodeBase(std::move(other)), - value_(std::move(other.value_)) {} -@@ -445,10 +450,13 @@ - - // The slot is empty when the next_ field is zero so it's safe to zero - // the backing. -- static const bool kEmptyValueIsZero = true; -+ static const bool kEmptyValueIsZero = ValueTraits::kEmptyValueIsZero; - - static const bool kHasIsEmptyValueFunction = true; - static bool IsEmptyValue(const Node& node) { return !node.next_; } -+ static Node EmptyValue() { -+ return Node(ValueTraits::EmptyValue(), nullptr, nullptr); -+ } - - static const int kDeletedValue = -1; - -diff --git a/third_party/blink/renderer/platform/wtf/list_hash_set_test.cc b/third_party/blink/renderer/platform/wtf/list_hash_set_test.cc -index 4c3f899..cd1be00 100644 ---- a/third_party/blink/renderer/platform/wtf/list_hash_set_test.cc -+++ b/third_party/blink/renderer/platform/wtf/list_hash_set_test.cc -@@ -487,6 +487,7 @@ - }; - - struct Complicated { -+ Complicated() : Complicated(0) {} - Complicated(int value) : simple_(value) { objects_constructed_++; } - - Complicated(const Complicated& other) : simple_(other.simple_) { -@@ -495,9 +496,6 @@ - - Simple simple_; - static int objects_constructed_; -- -- private: -- Complicated() = delete; - }; - - int Complicated::objects_constructed_ = 0; -@@ -731,4 +729,45 @@ - - } // anonymous namespace - -+// A unit type which objects to its state being initialized wrong. -+struct InvalidZeroValue { -+ InvalidZeroValue() = default; -+ InvalidZeroValue(WTF::HashTableDeletedValueType) : deleted_(true) {} -+ ~InvalidZeroValue() { CHECK(ok_); } -+ bool IsHashTableDeletedValue() const { return deleted_; } -+ -+ bool ok_ = true; -+ bool deleted_ = false; -+}; -+ -+template <> -+struct HashTraits : SimpleClassHashTraits { -+ static const bool kEmptyValueIsZero = false; -+}; -+ -+template <> -+struct DefaultHash { -+ struct Hash { -+ static unsigned GetHash(const InvalidZeroValue&) { return 0; } -+ static bool Equal(const InvalidZeroValue&, const InvalidZeroValue&) { -+ return true; -+ } -+ }; -+}; -+ -+template -+class ListOrLinkedHashSetInvalidZeroTest : public testing::Test {}; -+ -+using InvalidZeroValueSetTypes = -+ testing::Types, -+ ListHashSet, -+ LinkedHashSet>; -+TYPED_TEST_SUITE(ListOrLinkedHashSetInvalidZeroTest, InvalidZeroValueSetTypes); -+ -+TYPED_TEST(ListOrLinkedHashSetInvalidZeroTest, InvalidZeroValue) { -+ using Set = TypeParam; -+ Set set; -+ set.insert(InvalidZeroValue()); -+} -+ - } // namespace WTF diff --git a/chromium-78-protobuf-RepeatedPtrField-export.patch b/chromium-78-protobuf-RepeatedPtrField-export.patch deleted file mode 100644 index ddb9e80..0000000 --- a/chromium-78-protobuf-RepeatedPtrField-export.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/third_party/protobuf/src/google/protobuf/repeated_field.h b/third_party/protobuf/src/google/protobuf/repeated_field.h -index b5b193c..4434854 100644 ---- a/third_party/protobuf/src/google/protobuf/repeated_field.h -+++ b/third_party/protobuf/src/google/protobuf/repeated_field.h -@@ -804,7 +804,7 @@ class StringTypeHandler { - // RepeatedPtrField is like RepeatedField, but used for repeated strings or - // Messages. - template --class RepeatedPtrField final : private internal::RepeatedPtrFieldBase { -+class PROTOBUF_EXPORT RepeatedPtrField final : private internal::RepeatedPtrFieldBase { - public: - RepeatedPtrField(); - explicit RepeatedPtrField(Arena* arena); diff --git a/chromium-78.0.3904.70-gcc9-drop-rsp-clobber.patch b/chromium-78.0.3904.70-gcc9-drop-rsp-clobber.patch deleted file mode 100644 index 6785b09..0000000 --- a/chromium-78.0.3904.70-gcc9-drop-rsp-clobber.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -up chromium-78.0.3904.70/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h.gcc9 chromium-78.0.3904.70/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h ---- chromium-78.0.3904.70/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h.gcc9 2019-10-23 08:58:16.153251961 -0400 -+++ chromium-78.0.3904.70/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h 2019-10-23 08:58:36.896862347 -0400 -@@ -1486,7 +1486,7 @@ struct kernel_stat { - "d"(LSS_SYSCALL_ARG(parent_tidptr)), - "r"(LSS_SYSCALL_ARG(newtls)), - "r"(LSS_SYSCALL_ARG(child_tidptr)) -- : "rsp", "memory", "r8", "r10", "r11", "rcx"); -+ : "memory", "r8", "r10", "r11", "rcx"); - } - LSS_RETURN(int, __res); - } -diff -up chromium-78.0.3904.70/third_party/tcmalloc/vendor/src/base/linux_syscall_support.h.gcc9 chromium-78.0.3904.70/third_party/tcmalloc/vendor/src/base/linux_syscall_support.h ---- chromium-78.0.3904.70/third_party/tcmalloc/vendor/src/base/linux_syscall_support.h.gcc9 2019-10-23 08:58:59.623435488 -0400 -+++ chromium-78.0.3904.70/third_party/tcmalloc/vendor/src/base/linux_syscall_support.h 2019-10-23 08:59:16.113125772 -0400 -@@ -1485,7 +1485,7 @@ struct kernel_stat { - "d"(LSS_SYSCALL_ARG(parent_tidptr)), - "r"(LSS_SYSCALL_ARG(newtls)), - "r"(LSS_SYSCALL_ARG(child_tidptr)) -- : "rsp", "memory", "r8", "r10", "r11", "rcx"); -+ : "memory", "r8", "r10", "r11", "rcx"); - } - LSS_RETURN(int, __res); - } diff --git a/chromium-78.0.3904.70-unbundle-zlib.patch b/chromium-78.0.3904.70-unbundle-zlib.patch deleted file mode 100644 index 155990e..0000000 --- a/chromium-78.0.3904.70-unbundle-zlib.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up chromium-78.0.3904.70/third_party/perfetto/gn/BUILD.gn.unbundle-zlib chromium-78.0.3904.70/third_party/perfetto/gn/BUILD.gn ---- chromium-78.0.3904.70/third_party/perfetto/gn/BUILD.gn.unbundle-zlib 2019-10-23 09:25:44.419884187 -0400 -+++ chromium-78.0.3904.70/third_party/perfetto/gn/BUILD.gn 2019-10-23 09:29:53.553442745 -0400 -@@ -276,7 +276,7 @@ if (enable_perfetto_trace_processor || e - "//buildtools:zlib", - ] - } else { -- public_configs = [ "//third_party/zlib:zlib_config" ] -+ public_configs = [ "//third_party/zlib:system_zlib" ] - public_deps = [ - "//third_party/zlib", - ] diff --git a/chromium-78.0.3904.70-vtable-symbol-undefined.patch b/chromium-78.0.3904.70-vtable-symbol-undefined.patch deleted file mode 100644 index 13751a2..0000000 --- a/chromium-78.0.3904.70-vtable-symbol-undefined.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up chromium-78.0.3904.70/net/quic/platform/impl/quic_default_proof_providers_impl.cc.vtable-symbol-undefined chromium-78.0.3904.70/net/quic/platform/impl/quic_default_proof_providers_impl.cc ---- chromium-78.0.3904.70/net/quic/platform/impl/quic_default_proof_providers_impl.cc.vtable-symbol-undefined 2019-10-23 09:12:08.754351798 -0400 -+++ chromium-78.0.3904.70/net/quic/platform/impl/quic_default_proof_providers_impl.cc 2019-10-23 09:19:28.278431430 -0400 -@@ -18,6 +18,7 @@ - #include "net/quic/crypto/proof_verifier_chromium.h" - #include "net/third_party/quiche/src/quic/platform/api/quic_flags.h" - #include "net/third_party/quiche/src/quic/platform/api/quic_ptr_util.h" -+#include "net/quic/platform/impl/quic_flags_impl.cc" - - DEFINE_QUIC_COMMAND_LINE_FLAG( - bool, diff --git a/chromium-79-gcc-ambiguous-nodestructor.patch b/chromium-79-gcc-ambiguous-nodestructor.patch deleted file mode 100644 index d43a091..0000000 --- a/chromium-79-gcc-ambiguous-nodestructor.patch +++ /dev/null @@ -1,39 +0,0 @@ -From af77dc4014ead3d898fdc8a7a70fe5063ac9b102 Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Fri, 25 Oct 2019 19:01:29 +0000 -Subject: [PATCH] GCC: use brace-initializer for DohUpgrade vector - -Constructing NoDestructor with parenthesis constructor is ambiguous -in GCC. Use brace-initializer to avoid that problem. This fixes this -build error: - -Bug: 819294 -Change-Id: I00dda42daa1794d11e022f26ac07f92e599d106d -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1879910 -Reviewed-by: Eric Orth -Commit-Queue: José Dapena Paz -Cr-Commit-Position: refs/heads/master@{#709569} ---- - -diff --git a/net/dns/dns_util.cc b/net/dns/dns_util.cc -index 14997c4..637b6f2 100644 ---- a/net/dns/dns_util.cc -+++ b/net/dns/dns_util.cc -@@ -144,7 +144,7 @@ - // DohProviderId histogram suffix list in - // tools/metrics/histograms/histograms.xml. - static const base::NoDestructor> -- upgradable_servers({ -+ upgradable_servers{{ - DohUpgradeEntry( - "CleanBrowsingAdult", - {"185.228.168.10", "185.228.169.11", "2a0d:2a00:1::1", -@@ -215,7 +215,7 @@ - {"9.9.9.9", "149.112.112.112", "2620:fe::fe", "2620:fe::9"}, - {"dns.quad9.net", "dns9.quad9.net"} /* DoT hostname */, - {"https://dns.quad9.net/dns-query", true /* use_post */}), -- }); -+ }}; - return *upgradable_servers; - } - diff --git a/chromium-79-gcc-permissive.patch b/chromium-79-gcc-permissive.patch deleted file mode 100644 index c42d569..0000000 --- a/chromium-79-gcc-permissive.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 528e9a3e1f25bd264549c4c7779748abfd16bb1c Mon Sep 17 00:00:00 2001 -From: Jan Wilken Dörrie -Date: Fri, 18 Oct 2019 11:45:24 +0000 -Subject: [PATCH] Reland "GCC: Fix base::internal::InvokeFuncImpl" - -This is a reland of 9293d5c86eec1c34fc00716645400b44a14e764e - -Original change's description: -> GCC: Fix base::internal::InvokeFuncImpl -> -> GCC doesn't like that the Value data member has no out-of-line -> definition. The problem is triggered specifically only when compiling -> -> components/services/leveldb/leveldb_database_impl.cc -> -> which has lambda functions returning locally-defined classes. -> -> The current code works as-is in C++17 mode which introduces the concept -> of inline variables, but in C++14 we need either an explicit out-of-line -> definition or a function member instead of a data member. -> -> Use std::integral_constant for defining the value. -> -> Bug: 819294 -> Change-Id: I5c68e14ce3fa9d8b4d8a2cb42d7f9b53938aabf3 -> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1862451 -> Reviewed-by: Jan Wilken Dörrie -> Reviewed-by: Daniel Cheng -> Commit-Queue: Jüri Valdmann -> Cr-Commit-Position: refs/heads/master@{#706384} - -Bug: 819294 -Change-Id: I3d5a52ddc6815516e2239f9347c60de06bf765a2 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1865212 -Reviewed-by: Daniel Cheng -Commit-Queue: Jan Wilken Dörrie -Cr-Commit-Position: refs/heads/master@{#707329} ---- - -diff --git a/base/bind.h b/base/bind.h -index 7a400af..1070ce6 100644 ---- a/base/bind.h -+++ b/base/bind.h -@@ -187,18 +187,15 @@ - // well-formed. Using `Invoker::Run` with a OnceCallback triggers a - // static_assert, which is why the ternary expression does not compile. - // TODO(crbug.com/752720): Remove this indirection once we have `if constexpr`. --template --struct InvokeFuncImpl; -+template -+constexpr auto GetInvokeFunc(std::true_type) { -+ return Invoker::RunOnce; -+} - - template --struct InvokeFuncImpl { -- static constexpr auto Value = &Invoker::RunOnce; --}; -- --template --struct InvokeFuncImpl { -- static constexpr auto Value = &Invoker::Run; --}; -+constexpr auto GetInvokeFunc(std::false_type) { -+ return Invoker::Run; -+} - - template