Commit 42b687e7 authored by Tiancong Wang's avatar Tiancong Wang Committed by George Burgess

Enabling ThinLTO cache on Chrome OS.

Many Chrome OS bots started to run out of memory when linking Chrome
with ThinLTO. Will use ThinLTO cache as a workaround. Note this might
increase build time in Chrome OS for ~30min.

TBR=thakis@chromium.org

Bug: chromium:1038040, chromium:964328
Test: None
Change-Id: I95474cb23820c3c5cb109f74cfc87e74178700a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1984355
Commit-Queue: George Burgess <gbiv@chromium.org>
Commit-Queue: Achuith Bhandarkar <achuith@chromium.org>
Reviewed-by: default avatarGeorge Burgess <gbiv@chromium.org>
Reviewed-by: default avatarAchuith Bhandarkar <achuith@chromium.org>
Reviewed-by: default avatarTiancong Wang <tcwang@google.com>
Cr-Commit-Position: refs/heads/master@{#727851}
parent d4847c98
......@@ -613,25 +613,25 @@ config("compiler") {
} else {
ldflags += [ "-flto=thin" ]
# Enabling ThinLTO on Chrome OS too, in an effort to reduce the memory
# usage in crbug.com/1038040. Note this will increase build time in
# Chrome OS.
# Limit the parallelism to avoid too aggressive competition between
# linker jobs. This is still suboptimal to a potential dynamic
# resource allocation scheme, but should be good enough.
if (use_lld) {
ldflags += [ "-Wl,--thinlto-jobs=" + max_jobs_per_link ]
# Caching on Chrome OS materially slows the PFQ down; disable it until
# we can figure out why. (crbug.com/964328)
if (!is_chromeos) {
# Limit the size of the ThinLTO cache to the lesser of 10% of
# available disk space, 10GB and 100000 files.
cache_policy =
"cache_size=10%:cache_size_bytes=10g:cache_size_files=100000"
ldflags += [
"-Wl,--thinlto-cache-dir=" +
rebase_path("$root_out_dir/thinlto-cache", root_build_dir),
"-Wl,--thinlto-cache-policy,$cache_policy",
]
}
# Limit the size of the ThinLTO cache to the lesser of 10% of
# available disk space, 10GB and 100000 files.
cache_policy =
"cache_size=10%:cache_size_bytes=10g:cache_size_files=100000"
ldflags += [
"-Wl,--thinlto-cache-dir=" +
rebase_path("$root_out_dir/thinlto-cache", root_build_dir),
"-Wl,--thinlto-cache-policy,$cache_policy",
]
} else {
ldflags += [ "-Wl,-plugin-opt,jobs=" + max_jobs_per_link ]
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment