Revert "[clang] Build clang with pinned clang on all platforms"

This reverts commit e4598f8d5c0b63528f3b1450aaeafcefe2ddd8ad.

Reason for revert: breaks ToT win bots, e.g. https://ci.chromium.org/ui/p/chromium/builders/ci/ToTWin/1391/overview

Original change's description:
> [clang] Build clang with pinned clang on all platforms
>
> Followup to https://crrev.com/c/3572241.
>
> We can't use NamedTemporaryFile on Windows (can't read from it while having a handle to it): https://docs.python.org/3.9/library/tempfile.html. Use a consistent path for the pinned update.py instead.
>
> Bug: 1010466, 1013560
> Change-Id: Ibaa0e7d2e9789ac24a852f3c7083a59cb242e793
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3590911
> Reviewed-by: Hans Wennborg <hans@chromium.org>
> Commit-Queue: Arthur Eubanks <aeubanks@google.com>
> Cr-Commit-Position: refs/heads/main@{#997580}

Bug: 1010466, 1013560
Change-Id: Ia71a175de39d73aaa217fdf4e53df5d17b1cef84
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3616878
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Arthur Eubanks <aeubanks@google.com>
Auto-Submit: Arthur Eubanks <aeubanks@google.com>
Cr-Commit-Position: refs/heads/main@{#997944}
NOKEYCHECK=True
GitOrigin-RevId: f2a968f6513167caf5335dfbe6c29123675168af
diff --git a/scripts/build.py b/scripts/build.py
index 077257f..2475d6d 100755
--- a/scripts/build.py
+++ b/scripts/build.py
@@ -392,19 +392,16 @@
   # The update.py in this current revision may have a patched revision while
   # building new clang packages. Get update.py off HEAD~ to pull the current
   # pinned clang.
-  if not os.path.exists(PINNED_CLANG_DIR):
-    os.mkdir(os.path.join(PINNED_CLANG_DIR))
-
-  script_path = os.path.join(PINNED_CLANG_DIR, 'update.py')
-
-  with open(script_path, 'w') as f:
+  with tempfile.NamedTemporaryFile() as f:
     subprocess.check_call(
         ['git', 'show', 'HEAD~:tools/clang/scripts/update.py'],
         stdout=f,
         cwd=CHROMIUM_DIR)
-  print("Running pinned update.py")
-  subprocess.check_call(
-      [sys.executable, script_path, '--output-dir=' + PINNED_CLANG_DIR])
+    print("Running update.py")
+    # Without the flush, the subprocess call below doesn't work.
+    f.flush()
+    subprocess.check_call(
+        [sys.executable, f.name, '--output-dir=' + PINNED_CLANG_DIR])
 
 
 # TODO(crbug.com/929645): Remove once we don't need gcc's libstdc++.
@@ -663,31 +660,17 @@
       '-DLIBCLANG_BUILD_STATIC=ON',
   ]
 
-  DownloadPinnedClang()
-  if sys.platform == 'win32':
-    cc = os.path.join(PINNED_CLANG_DIR, 'bin', 'clang-cl.exe')
-    cxx = os.path.join(PINNED_CLANG_DIR, 'bin', 'clang-cl.exe')
-    lld = os.path.join(PINNED_CLANG_DIR, 'bin', 'lld-link.exe')
-    # CMake has a hard time with backslashes in compiler paths:
-    # https://stackoverflow.com/questions/13050827
-    cc = cc.replace('\\', '/')
-    cxx = cxx.replace('\\', '/')
-    lld = lld.replace('\\', '/')
-  else:
-    cc = os.path.join(PINNED_CLANG_DIR, 'bin', 'clang')
-    cxx = os.path.join(PINNED_CLANG_DIR, 'bin', 'clang++')
-
-  if sys.platform != 'darwin':
-    # The host clang has lld, but self-hosting with lld is still slightly
-    # broken on mac.
-    base_cmake_args.append('-DLLVM_ENABLE_LLD=ON')
-
   if sys.platform.startswith('linux'):
     MaybeDownloadHostGcc(args)
+    DownloadPinnedClang()
+    cc = os.path.join(PINNED_CLANG_DIR, 'bin', 'clang')
+    cxx = os.path.join(PINNED_CLANG_DIR, 'bin', 'clang++')
     # Use the libraries in the specified gcc installation for building.
     cflags.append('--gcc-toolchain=' + args.gcc_toolchain)
     cxxflags.append('--gcc-toolchain=' + args.gcc_toolchain)
     base_cmake_args += [
+        # The host clang has lld.
+        '-DLLVM_ENABLE_LLD=ON',
         '-DLLVM_STATIC_LINK_CXX_STDLIB=ON',
         # Force compiler-rt tests to use our gcc toolchain
         # because the one on the host may be too old.
diff --git a/scripts/update.py b/scripts/update.py
index 6fc4730..fed2ea0 100755
--- a/scripts/update.py
+++ b/scripts/update.py
@@ -36,7 +36,7 @@
 # Reverting problematic clang rolls is safe, though.
 # This is the output of `git describe` and is usable as a commit-ish.
 CLANG_REVISION = 'llvmorg-15-init-8945-g3d7da810'
-CLANG_SUB_REVISION = 2
+CLANG_SUB_REVISION = 1
 
 PACKAGE_VERSION = '%s-%s' % (CLANG_REVISION, CLANG_SUB_REVISION)
 RELEASE_VERSION = '15.0.0'