clang packaging: Build compiler-rt as part of the normal build on Linux too.

Previously, we built it in a separate build directory for no
good reason.

Also stop building compiler-rt during bootstrap on Windows
(and don't start building it during bootstrap on Linux, now
that we add compiler-rt during the normal build on Linux).

Also severely limit how much of compiler-rt we build during
bootstrap on macOS: We only need the builtins library for
x86_64. So disable other parts of compiler-rt, and build
the builtins library only for macOS (not for iOS), and only
for x86_64 (not i386 and x86_64h).

No intended behavior change, the final package should not
change due to this. (But in practice we start bundling the
xray headers since package.py packs lib/clang/*/include/*
and previously when we had a separate build dir for
compiler-rt we only copied the sanitizer/ headers over.
The xray headers are small, so it's ok -- and we can
set -DCOMPILER_RT_BUILD_XRAY=OFF for stage 2 on all
platforms in the follow-up where we also disable some
compiler-rt archs for stage 2 on macOS. Also, on Linux,
the runtime .a files are now built with -ffunction-sections
-fdata-sections, which makes them a bit bigger -- but
linking against them should now produce slightly smaller
binaries in turn.)

linux_upload_clang cycle time seems unaffected (which makes
sense, since it does basically the same work before and
after this change).

win_upload_clang cycle time goes down by ~1-10 minutes
(the build times on the builds in the last 2 days before
this change were 1 hrs 52 mins, 1 hrs 54 mins, 1 hrs 51 mins,
1 hrs 56 mins, 1 hrs 47 mins, 1 hrs 52 mins; the build time
with this patch was 1 hrs 46 mins. Again, this makes sense since
win_upload_clang now no longer needs to build compiler-rt during
bootstrap).

mac_upload_clang cycle time recovers some of the losses from,
30-40min faster:
https://chromium-review.googlesource.com/c/chromium/src/+/1594894 :
(Before this change: 3 hrs, 3 hrs 7 mins, 3 hrs 10 mins,
3 hrs 14 mins, 3 hrs 8 mins, 3 hrs 8 mins, 3 hrs 14 mins; with
this change: 2 hrs 31 mins. macOS built compiler-rt in the most
configurations during bootstrap, so it makes sense the win is
biggest here – from ~7900 build steps for bootstrap to ~3300).

(See patch set 22 for the bot times.)

Bug: 959966,959361
Change-Id: I896c06ef7377a72da8b751994263437c7a00d04f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1605422
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Hans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#661218}
2 files changed