clang: Use gcc package built for bionic as host gcc

Now that linux_upload_clang is on bionic, we can build gcc it
downloads on bionic too.

I built this gcc in a ubuntu:bionic image as described here:
https://bugs.chromium.org/p/chromium/issues/detail?id=1302636#c18

The clang build uses an older clang as host compiler for building
the bootstrap compiler (on the packaging bots) or the final
compiler (on the ToT bots), but we still use the libstdc++ from
the gcc image at the moment. (It's statically linked into
the final clang, and some rust tooling uses that libstdc++ too).

The clang we build already requires bionic (since linux_upload_clang
runs bionic, and clang isn't' built in a sysroot yet), so
libstdc++ requiring bionic shouldn't cause any new issues.

The current (trusty-based) gcc had header issues that made
it impossible to use it with a sysroot for building clang.
This is better with gcc targeting a slightly newer linux
(or, rather, glibc). So this change hopefully helps with
eventually building clang itself against a sysroot.

Hopefully no behavior change.

Bug: 1302636
Change-Id: Ib65a7135418985c0a53d23e62682d1bd5e26ca86
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3650696
Reviewed-by: Hans Wennborg <hans@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1004473}
NOKEYCHECK=True
GitOrigin-RevId: 1b307efd06d29068c5fac51b539a98d4989b9f99
diff --git a/scripts/build.py b/scripts/build.py
index 1e4ae2c..c0ecf12 100755
--- a/scripts/build.py
+++ b/scripts/build.py
@@ -410,9 +410,11 @@
   assert sys.platform.startswith('linux')
   if args.gcc_toolchain:
     return
-  gcc_dir = os.path.join(LLVM_BUILD_TOOLS_DIR, 'gcc-10.2.0-trusty')
+  gcc_dir = os.path.join(LLVM_BUILD_TOOLS_DIR, 'gcc-10.2.0-bionic')
+  if os.path.isdir(gcc_dir):  # TODO(thakis): Remove this branch after a few weeks.
+    RmTree(gcc_dir)
   if not os.path.exists(gcc_dir):
-    DownloadAndUnpack(CDS_URL + '/tools/gcc-10.2.0-trusty.tgz', gcc_dir)
+    DownloadAndUnpack(CDS_URL + '/tools/gcc-10.2.0-bionic.tgz', gcc_dir)
   args.gcc_toolchain = gcc_dir
 
 
diff --git a/scripts/update.py b/scripts/update.py
index cb2a5a3..da5cc70 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-10168-gc2a7904a'
-CLANG_SUB_REVISION = 1
+CLANG_SUB_REVISION = 2
 
 PACKAGE_VERSION = '%s-%s' % (CLANG_REVISION, CLANG_SUB_REVISION)
 RELEASE_VERSION = '15.0.0'