···478 # allowing us to use our rustc and our clang.
479 ./patches/chromium-129-rust.patch
480 ]
481- ++ lib.optionals (chromiumVersionAtLeast "140") [
482 # Rebased variant of the patch above due to
483 # https://chromium-review.googlesource.com/c/chromium/src/+/6665907
484 ./patches/chromium-140-rust.patch
00000485 ]
486 ++ lib.optionals stdenv.hostPlatform.isAarch64 [
487 # Reverts decommit pooled pages which causes random crashes of tabs on systems
···523 # Rebased variant of the patch above for
524 # electron 35 (M134) and 36 (M136)
525 ./patches/chromium-134-rust-1.86-mismatched_lifetime_syntaxes.patch
00000000000526 ];
527528 postPatch =
···736 # Disable PGO because the profile data requires a newer compiler version (LLVM 14 isn't sufficient):
737 chrome_pgo_phase = 0;
738 clang_base_path = "${llvmCcAndBintools}";
739-00000740 use_qt5 = false;
741 use_qt6 = false;
742
···478 # allowing us to use our rustc and our clang.
479 ./patches/chromium-129-rust.patch
480 ]
481+ ++ lib.optionals (versionRange "140" "141") [
482 # Rebased variant of the patch above due to
483 # https://chromium-review.googlesource.com/c/chromium/src/+/6665907
484 ./patches/chromium-140-rust.patch
485+ ]
486+ ++ lib.optionals (chromiumVersionAtLeast "141") [
487+ # Rebased variant of the patch above due to
488+ # https://chromium-review.googlesource.com/c/chromium/src/+/6897026
489+ ./patches/chromium-141-rust.patch
490 ]
491 ++ lib.optionals stdenv.hostPlatform.isAarch64 [
492 # Reverts decommit pooled pages which causes random crashes of tabs on systems
···528 # Rebased variant of the patch above for
529 # electron 35 (M134) and 36 (M136)
530 ./patches/chromium-134-rust-1.86-mismatched_lifetime_syntaxes.patch
531+ ]
532+ ++ lib.optionals (chromiumVersionAtLeast "141") [
533+ (fetchpatch {
534+ # Fix "invalid application of 'sizeof' to an incomplete type 'blink::CSSStyleSheet'"
535+ # by reverting https://chromium-review.googlesource.com/c/chromium/src/+/6892157
536+ name = "chromium-141-Revert-Remove-unnecessary-include-in-tree_scope.h.patch";
537+ url = "https://chromium.googlesource.com/chromium/src/+/0fc0e71aa1ca0419fae6d14255025543980d2cba^!?format=TEXT";
538+ decode = "base64 -d";
539+ revert = true;
540+ hash = "sha256-pnEus2NHpNWZ6ZSXLgdTn+it7oy1MPZPbD8SOAKLWbw=";
541+ })
542 ];
543544 postPatch =
···752 # Disable PGO because the profile data requires a newer compiler version (LLVM 14 isn't sufficient):
753 chrome_pgo_phase = 0;
754 clang_base_path = "${llvmCcAndBintools}";
755+ }
756+ // lib.optionalAttrs (chromiumVersionAtLeast "141") {
757+ # TODO: remove opt-out of https://chromium.googlesource.com/chromium/src/+/main/docs/modules.md
758+ use_clang_modules = false;
759+ }
760+ // {
761 use_qt5 = false;
762 use_qt6 = false;
763
···1+diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
2+index 516f7d85fc5718a26707d988389081cd86da49bd..f4b5284ad90591a57cb803353bbe57fd4e213159 100644
3+--- a/build/config/compiler/BUILD.gn
4++++ b/build/config/compiler/BUILD.gn
5+@@ -1911,16 +1911,6 @@ config("runtime_library") {
6+ configs += [ "//build/config/c++:runtime_library" ]
7+ }
8+9+- # Rust and C++ both provide intrinsics for LLVM to call for math operations. We
10+- # want to use the C++ intrinsics, not the ones in the Rust compiler_builtins
11+- # library. The Rust symbols are marked as weak, so that they can be replaced by
12+- # the C++ symbols. This config ensures the C++ symbols exist and are strong in
13+- # order to cause that replacement to occur by explicitly linking in clang's
14+- # compiler-rt library.
15+- if (is_clang && !(is_a_target_toolchain && is_cronet_build)) {
16+- configs += [ "//build/config/clang:compiler_builtins" ]
17+- }
18+-
19+ # TODO(crbug.com/40570904): Come up with a better name for is POSIX + Fuchsia
20+ # configuration.
21+ if (is_posix || is_fuchsia) {