Roll build folder

This patch rolls the `build/` folder and other third-party folders
to match their revisions to the ones used by the latest Chromium in
order to use the latest Windows 11 SDK 26100.

Fixed: chromium:374852565
Change-Id: I16185ff539e113c1c4bafcc04932d59769bbff48
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/211954
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
diff --git a/.gitmodules b/.gitmodules
index a52398c..7484713 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -18,6 +18,10 @@
 	path = third_party/libc++abi/src
 	url = https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi
 	gclient-condition = dawn_standalone
+[submodule "third_party/libdrm/src"]
+	path = third_party/libdrm/src
+	url = https://chromium.googlesource.com/chromiumos/third_party/libdrm
+	gclient-condition = dawn_standalone and host_os == "linux"
 [submodule "build"]
 	path = build
 	url = https://chromium.googlesource.com/chromium/src/build
diff --git a/DEPS b/DEPS
index 83c75d3..88a0903 100644
--- a/DEPS
+++ b/DEPS
@@ -117,19 +117,25 @@
     'condition': 'dawn_standalone',
   },
 
+  # Required by //build on Linux
+  'third_party/libdrm/src': {
+    'url': '{chromium_git}/chromiumos/third_party/libdrm.git@ad78bb591d02162d3b90890aa4d0a238b2a37cde',
+    'condition': 'dawn_standalone and host_os == "linux"',
+  },
+
   # Dependencies required to use GN, Clang, and Rust in standalone.
   # The //build, //tools/clang, and //tools/rust deps should all be updated
   # in unison, as there are dependencies between them.
   'build': {
-    'url': '{chromium_git}/chromium/src/build@a6c1c751fd8c18d9e051b12600aec2753c1712c3',
+    'url': '{chromium_git}/chromium/src/build@9d5c32282de17517d92763af2d11dbeb1f6539aa',
     'condition': 'dawn_standalone',
   },
   'tools/clang': {
-    'url': '{chromium_git}/chromium/src/tools/clang@06a29b5bbf392c68d73dc8df9015163cc5a98c40',
+    'url': '{chromium_git}/chromium/src/tools/clang@53554bf3da41153f2e01f9ff234c194c156b7a93',
     'condition': 'dawn_standalone',
   },
   'tools/rust': {
-    'url': '{chromium_git}/chromium/src/tools/rust@a69a8ecdbf7a19fb129ae57650cac9f704cb7cf9',
+    'url': '{chromium_git}/chromium/src/tools/rust@ed0fe5c0e067bd64ab43eb7457e71680a81bd8e3',
     'condition': 'dawn_standalone and checkout_rust',
   },
   'tools/clang/dsymutil': {
@@ -243,7 +249,7 @@
     'condition': 'dawn_standalone',
   },
   'third_party/google_benchmark/src': {
-    'url': '{chromium_git}/external/github.com/google/benchmark.git' + '@' + 'efc89f0b524780b1994d5dddd83a92718e5be492',
+    'url': '{chromium_git}/external/github.com/google/benchmark.git' + '@' + '761305ec3b33abf30e08d50eb829e19a802581cc',
     'condition': 'dawn_standalone',
   },
 
diff --git a/build b/build
index a6c1c75..9d5c322 160000
--- a/build
+++ b/build
@@ -1 +1 @@
-Subproject commit a6c1c751fd8c18d9e051b12600aec2753c1712c3
+Subproject commit 9d5c32282de17517d92763af2d11dbeb1f6539aa
diff --git a/generator/templates/api_cpp.h b/generator/templates/api_cpp.h
index 61fed4f..d7fc632 100644
--- a/generator/templates/api_cpp.h
+++ b/generator/templates/api_cpp.h
@@ -189,11 +189,11 @@
     }
 
     // Comparison functions.
-    bool operator==({{OptionalBoolCType}} rhs) const {
-        return mValue == rhs;
+    friend bool operator==(const {{OptionalBoolCppType}}& lhs, const {{OptionalBoolCppType}}& rhs) {
+        return lhs.mValue == rhs.mValue;
     }
-    bool operator!=({{OptionalBoolCType}} rhs) const {
-        return mValue != rhs;
+    friend bool operator!=(const {{OptionalBoolCppType}}& lhs, const {{OptionalBoolCppType}}& rhs) {
+        return lhs.mValue != rhs.mValue;
     }
 
   private:
diff --git a/src/dawn/node/interop/Core.h b/src/dawn/node/interop/Core.h
index 438ffcd..eb07517 100644
--- a/src/dawn/node/interop/Core.h
+++ b/src/dawn/node/interop/Core.h
@@ -215,8 +215,10 @@
     inline operator Napi::Promise() const { return state_->deferred.Promise(); }
 
     // Comparison operator between promises
-    bool operator==(const PromiseBase& other) { return state_ == other.state_; }
-    bool operator!=(const PromiseBase& other) { return !(*this == other); }
+    friend bool operator==(const PromiseBase& lhs, const PromiseBase& rhs) {
+        return lhs.state_ == rhs.state_;
+    }
+    friend bool operator!=(const PromiseBase& lhs, const PromiseBase& rhs) { return !(lhs == rhs); }
 
     // Reject() rejects the promise with the given failure value.
     void Reject(Napi::Value value) const {
diff --git a/src/tint/lang/spirv/reader/ast_lower/atomics.cc b/src/tint/lang/spirv/reader/ast_lower/atomics.cc
index ea2b778..54588d6 100644
--- a/src/tint/lang/spirv/reader/ast_lower/atomics.cc
+++ b/src/tint/lang/spirv/reader/ast_lower/atomics.cc
@@ -262,7 +262,7 @@
         for (auto* node : ctx.src->ASTNodes().Objects()) {
             if (auto* load = ctx.src->Sem().Get<sem::Load>(node)) {
                 if (is_ref_to_atomic_var(load->Source())) {
-                    ctx.Replace(load->Source()->Declaration(), [=] {
+                    ctx.Replace(load->Source()->Declaration(), [load, this] {
                         auto* expr = ctx.CloneWithoutTransform(load->Source()->Declaration());
                         return b.Call(wgsl::BuiltinFn::kAtomicLoad, b.AddressOf(expr));
                     });
@@ -270,7 +270,7 @@
             } else if (auto* assign = node->As<ast::AssignmentStatement>()) {
                 auto* sem_lhs = ctx.src->Sem().GetVal(assign->lhs);
                 if (is_ref_to_atomic_var(sem_lhs)) {
-                    ctx.Replace(assign, [=] {
+                    ctx.Replace(assign, [assign, this] {
                         auto* lhs = ctx.CloneWithoutTransform(assign->lhs);
                         auto* rhs = ctx.CloneWithoutTransform(assign->rhs);
                         auto* call = b.Call(wgsl::BuiltinFn::kAtomicStore, b.AddressOf(lhs), rhs);
diff --git a/src/tint/lang/spirv/reader/ast_parser/function.cc b/src/tint/lang/spirv/reader/ast_parser/function.cc
index 6ce6314..475e339 100644
--- a/src/tint/lang/spirv/reader/ast_parser/function.cc
+++ b/src/tint/lang/spirv/reader/ast_parser/function.cc
@@ -886,7 +886,7 @@
     auto* cond = builder_.Expr(Source{}, guard_name);
     auto* builder = AddStatementBuilder<IfStatementBuilder>(cond);
 
-    PushNewStatementBlock(top.GetConstruct(), end_id, [=](const StatementList& stmts) {
+    PushNewStatementBlock(top.GetConstruct(), end_id, [builder, this](const StatementList& stmts) {
         builder->body = create<ast::BlockStatement>(Source{}, stmts, tint::Empty);
     });
 }
@@ -898,7 +898,7 @@
     auto* cond = MakeTrue(Source{});
     auto* builder = AddStatementBuilder<IfStatementBuilder>(cond);
 
-    PushNewStatementBlock(top.GetConstruct(), end_id, [=](const StatementList& stmts) {
+    PushNewStatementBlock(top.GetConstruct(), end_id, [builder, this](const StatementList& stmts) {
         builder->body = create<ast::BlockStatement>(Source{}, stmts, tint::Empty);
     });
 }
@@ -2927,7 +2927,7 @@
     // But make sure we do it in the right order.
     auto push_else = [this, builder, else_end, construct, false_is_break, false_is_continue] {
         // Push the else clause onto the stack first.
-        PushNewStatementBlock(construct, else_end, [=](const StatementList& stmts) {
+        PushNewStatementBlock(construct, else_end, [builder, this](const StatementList& stmts) {
             // Only set the else-clause if there are statements to fill it.
             if (!stmts.IsEmpty()) {
                 // The "else" consists of the statement list from the top of
@@ -2978,7 +2978,7 @@
         }
 
         // Push the then clause onto the stack.
-        PushNewStatementBlock(construct, then_end, [=](const StatementList& stmts) {
+        PushNewStatementBlock(construct, then_end, [builder, this](const StatementList& stmts) {
             builder->body = create<ast::BlockStatement>(Source{}, stmts, tint::Empty);
         });
         if (true_is_break) {
@@ -3091,10 +3091,11 @@
         // for the case, and fill the case clause once the block is generated.
         auto case_idx = swch->cases.Length();
         swch->cases.Push(nullptr);
-        PushNewStatementBlock(construct, end_id, [=](const StatementList& stmts) {
-            auto* body = create<ast::BlockStatement>(Source{}, stmts, tint::Empty);
-            swch->cases[case_idx] = create<ast::CaseStatement>(Source{}, selectors, body);
-        });
+        PushNewStatementBlock(
+            construct, end_id, [swch, case_idx, selectors, this](const StatementList& stmts) {
+                auto* body = create<ast::BlockStatement>(Source{}, stmts, tint::Empty);
+                swch->cases[case_idx] = create<ast::CaseStatement>(Source{}, selectors, body);
+            });
 
         if (i == 0) {
             break;
@@ -3106,9 +3107,10 @@
 
 bool FunctionEmitter::EmitLoopStart(const Construct* construct) {
     auto* builder = AddStatementBuilder<LoopStatementBuilder>();
-    PushNewStatementBlock(construct, construct->end_id, [=](const StatementList& stmts) {
-        builder->body = create<ast::BlockStatement>(Source{}, stmts, tint::Empty);
-    });
+    PushNewStatementBlock(
+        construct, construct->end_id, [builder, this](const StatementList& stmts) {
+            builder->body = create<ast::BlockStatement>(Source{}, stmts, tint::Empty);
+        });
     return success();
 }
 
@@ -3121,7 +3123,7 @@
         return Fail() << "internal error: starting continue construct, "
                          "expected loop on top of stack";
     }
-    PushNewStatementBlock(construct, construct->end_id, [=](const StatementList& stmts) {
+    PushNewStatementBlock(construct, construct->end_id, [loop, this](const StatementList& stmts) {
         loop->continuing = create<ast::BlockStatement>(Source{}, stmts, tint::Empty);
     });
 
diff --git a/third_party/google_benchmark/BUILD.gn b/third_party/google_benchmark/BUILD.gn
index 779cf2a..00f9282 100644
--- a/third_party/google_benchmark/BUILD.gn
+++ b/third_party/google_benchmark/BUILD.gn
@@ -2,8 +2,6 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
-import("//build_overrides/build.gni")
-
 config("benchmark_config") {
   include_dirs = [ "src/include" ]
 
@@ -64,10 +62,8 @@
 
   all_dependent_configs = [ ":benchmark_config" ]
 
-  if (build_with_chromium) {
-    configs -= [ "//build/config/compiler:chromium_code" ]
-    configs += [ "//build/config/compiler:no_chromium_code" ]
-  }
+  configs -= [ "//build/config/compiler:chromium_code" ]
+  configs += [ "//build/config/compiler:no_chromium_code" ]
 
   if (is_win) {
     configs -= [ "//build/config/win:nominmax" ]
@@ -77,9 +73,10 @@
     "benchmark_EXPORTS=1",
 
     # Tell gtest to always use standard regular expressions.
-    "HAVE_GNU_POSIX_REGEX=0",
-    "HAVE_POSIX_REGEX=0",
     "HAVE_STD_REGEX=1",
+
+    # google_benchmark expects a BENCHMARK_VERSION definition
+    "BENCHMARK_VERSION=\"1.9.0\"",
   ]
 }
 
diff --git a/third_party/google_benchmark/src b/third_party/google_benchmark/src
index efc89f0..761305e 160000
--- a/third_party/google_benchmark/src
+++ b/third_party/google_benchmark/src
@@ -1 +1 @@
-Subproject commit efc89f0b524780b1994d5dddd83a92718e5be492
+Subproject commit 761305ec3b33abf30e08d50eb829e19a802581cc
diff --git a/third_party/libdrm/BUILD.gn b/third_party/libdrm/BUILD.gn
new file mode 100644
index 0000000..f3a486d
--- /dev/null
+++ b/third_party/libdrm/BUILD.gn
@@ -0,0 +1,109 @@
+# Copyright 2016 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+assert(is_linux || is_chromeos)
+
+generated_static_table_fourcc_file =
+    "$target_gen_dir/src/generated_static_table_fourcc.h"
+fourcc_file = "src/include/drm/drm_fourcc.h"
+
+action("make_generated_static_table_fourcc") {
+  script = "src/gen_table_fourcc.py"
+  args = [
+    rebase_path(fourcc_file, root_build_dir),
+    rebase_path(generated_static_table_fourcc_file),
+  ]
+  outputs = [ generated_static_table_fourcc_file ]
+  inputs = [ fourcc_file ]
+}
+
+config("libdrm_config") {
+  # TODO(thomasanderson): Remove this hack once
+  # https://patchwork.kernel.org/patch/10545295/ lands.
+  defines = [ "typeof(x)=__typeof__(x)" ]
+
+  include_dirs = [
+    "src",
+    "src/include",
+    "src/include/drm",
+  ]
+
+  # libdrm uses macros defined by <sys/types.h> which are being moved to
+  # <sys/sysmacros.h>.  GLIBC headers give a pragma warning in this case.
+  # Suppress this warning for now.  This may be removed once
+  # https://patchwork.kernel.org/patch/9628231/ lands.
+  cflags = [ "-Wno-#pragma-messages" ]
+
+  # glibc version >= 2.25 explicitly include <sys/sysmacros.h>
+  cflags += [ "-DMAJOR_IN_SYSMACROS=1" ]
+
+  # TODO(b/357680612): unused function 'swap32'.
+  cflags += [ "-Wno-unused-function" ]
+
+  if (is_clang) {
+    cflags += [
+      "-Wno-enum-conversion",
+
+      # TODO(crbug.com/932060) fix unused result from asprintf in modetest.c.
+      "-Wno-unused-result",
+
+      # modetest.c has an improper conversion in a printf statement.
+      "-Wno-format",
+    ]
+  }
+}
+
+static_library("libdrm") {
+  sources = [
+    "src/xf86drm.c",
+    "src/xf86drmHash.c",
+    "src/xf86drmMode.c",
+    "src/xf86drmRandom.c",
+  ]
+
+  deps = [ ":make_generated_static_table_fourcc" ]
+
+  include_dirs = [
+    get_path_info(generated_static_table_fourcc_file, "dir"),
+    "src",
+    "src/include",
+  ]
+  configs -= [ "//build/config/compiler:chromium_code" ]
+  configs += [ "//build/config/compiler:no_chromium_code" ]
+  cflags = [
+    # xf86drm.c uses readdir_r, which has been deprecated as of
+    # glibc-2.24.  This causes a build error when using the Debian
+    # Stretch sysroot.
+    "-Wno-deprecated-declarations",
+  ]
+
+  public_configs = [ ":libdrm_config" ]
+}
+
+executable("modetest") {
+  sources = [
+    "src/tests/modetest/buffers.c",
+    "src/tests/modetest/buffers.h",
+    "src/tests/modetest/cursor.c",
+    "src/tests/modetest/cursor.h",
+    "src/tests/modetest/modetest.c",
+    "src/tests/util/common.h",
+    "src/tests/util/format.c",
+    "src/tests/util/format.h",
+    "src/tests/util/kms.c",
+    "src/tests/util/kms.h",
+    "src/tests/util/pattern.c",
+    "src/tests/util/pattern.h",
+  ]
+
+  include_dirs = [
+    "src/tests",
+    "src/tests/modetest",
+  ]
+
+  configs -= [ "//build/config/compiler:chromium_code" ]
+  configs += [ "//build/config/compiler:no_chromium_code" ]
+  configs += [ ":libdrm_config" ]
+
+  deps = [ ":libdrm" ]
+}
diff --git a/third_party/libdrm/README.chromium b/third_party/libdrm/README.chromium
new file mode 100644
index 0000000..e87b10e
--- /dev/null
+++ b/third_party/libdrm/README.chromium
@@ -0,0 +1,13 @@
+Name: libdrm
+Short Name: libdrm
+URL: https://chromium.googlesource.com/chromiumos/third_party/libdrm
+Version: 2.4.122
+License: MIT
+Security Critical: yes
+Shipped: no
+
+Description:
+Userspace interface to kernel DRM services.
+
+Local Modifications:
+None
diff --git a/third_party/libdrm/src b/third_party/libdrm/src
new file mode 160000
index 0000000..ad78bb5
--- /dev/null
+++ b/third_party/libdrm/src
@@ -0,0 +1 @@
+Subproject commit ad78bb591d02162d3b90890aa4d0a238b2a37cde
diff --git a/tools/clang b/tools/clang
index 06a29b5..53554bf 160000
--- a/tools/clang
+++ b/tools/clang
@@ -1 +1 @@
-Subproject commit 06a29b5bbf392c68d73dc8df9015163cc5a98c40
+Subproject commit 53554bf3da41153f2e01f9ff234c194c156b7a93
diff --git a/tools/rust b/tools/rust
index a69a8ec..ed0fe5c 160000
--- a/tools/rust
+++ b/tools/rust
@@ -1 +1 @@
-Subproject commit a69a8ecdbf7a19fb129ae57650cac9f704cb7cf9
+Subproject commit ed0fe5c0e067bd64ab43eb7457e71680a81bd8e3